Splitting an axis into a linear and log scale
古いコメントを表示
Hi,
I'm interested in splitting the x-axis of a plot into a linear section and a log section. For example, I want to plot -1 to 20 on a linear scale then switch to a log scale for 20 to 4500 on the same axis. I've looked into functions like semilog and plotxx, and log log, but I can't find anything that allows me to split the axis into two separate scales.
Thanks a lot, Charles
採用された回答
その他の回答 (1 件)
Youssef Khmou
2013 年 6 月 20 日
編集済み: Youssef Khmou
2013 年 6 月 20 日
hi Senaasa,
There must a sophisticated way to produce such arrangement, that method is used in many papers related to geophysics, however i propose to you a manual way to try :
Let us consider the problem that we want represent a sinusoidal function on N=600 points such as 230 is limit between the linear and log scales,
N=600;
T=400; % Number of points on the first interval
x1=linspace(0,230,T);
TT=(N-230)*T/230;
x2=logspace(230,N,TT);
x=[x1 x2];
y=sin(2*pi*x*0.025); % frequency of 0.25Hz
Now the most important part, is to use the plot command without the x axis, if you add the x axis, that will create an entropy in the figure :
figure, plot(y);
title(' Linear AND logarithmic scales merged, break point =230' );
カテゴリ
ヘルプ センター および File Exchange で Labels and Styling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!