scatter plot with non-linear axis

Hi together!
I have been trying for a while now to make a certain graph, but just do not succeed :-(
Here is what I need:
A scatter plot, where the y axis is linear scaled: y = [0.7, 0.9] and the x-axis is non-linear scaled: x = [1/128, 1/64, 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2]
Could anybody PLEASE help me??

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 17일

2 개 추천

x=1:10
y=sin(x)
x1=1./2.^(-1:length(x)-2),
scatter(x1,y)

댓글 수: 6

Birgit
Birgit 2012년 11월 17일
Thank you Azzi for your answer! However it doesn't work for me. :-( when I copy your code I still get a linearly scaled axis??
Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 17일
I am not getting this message, are you sur you din'nt do anything else
Birgit
Birgit 2012년 11월 17일
yes, I am sure I didn't do anything else. I copied it 1:1 and I get a linearly scaled axis
try this
close
x=1:10
y=sin(x)
x1=1./2.^(-1:length(x)-2),
scatter(x,y)
set(gca,'xticklabel',fliplr(x1))
grid
set(gca, 'XScale', 'log')
This will give you log 10, but log 2 is a linear multiple of log 10.
Birgit
Birgit 2012년 11월 17일
thanks to both of you! :-) it's great to get help here!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by