How to use two different scales on one same axis: logarithmic from 0.1 to 1 and linear from then on

I'm trying to reproduce the graphic below. I've got all the data but I don't manage to set the x-axis scale to reproduce the same display: logarithmic scale from 0.1 - 1 and linear from 1-4
Currently using Matlab 2012.a

 採用された回答

Joan Sngl
Joan Sngl 2013 年 2 月 23 日
Hey problem solved. I've plotted the points with x axis logarithmic and the results are enough good so no need to worry more about this question.
Thanks for the help.

その他の回答 (1 件)

hi, Joan
The well known functions for plotting data with logarithmic scales are :
semilogx,semilogy, and loglog for both x and y axis .
lets try a way out :
Suppose Y data has N elements
>>N=length(Y);
>>x=linspace(0.1,4,N); % Linear vector of N points from 0.1 to 4.
>>indx=find(x==1.00);
% Now make the first portion logarithmic
>>x(1:indx)=log10(x(1:indx)); % plot(x) has two parts Log +Lin
Try this generated x axis and see.......

2 件のコメント

Depending on the length N , indx may by "empty matrix" then try to find manually the position where x is approx 1 .
Joan Sngl
Joan Sngl 2013 年 2 月 23 日
Thanks for the replay but I'm afraid this is not what I'm looking for. I already have the set of data points (X and Y) but I don't manage to represent them like in the first figure where the AXIS scale goes logarithmic from 0.1 to 1 and linear from 1-4.
This is how it looks like using normal plot function:

サインインしてコメントする。

カテゴリ

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by