2011-10-27 177 views
1

因此当我绘制我的图我得到以下结果 enter image description hereX轴与MATLAB绘制缩放

我的数据是稀疏正如你所看到的第一个x轴的刻度开始于500(S),但我大部分数据在30(s)左右。我可以更改x轴的缩放比例吗?

+3

您可以用'semilogx',而不是'plot'使x轴的对数。 –

回答

3

这个怎么样?

X = [1 3 6 10 25 30 235 678 1248]; 
Y = [0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.8 0.9]; 
plot(X,Y,'-b.') 
figure 
semilogx(X,Y,'-b.') 

我看到下面的输出:

enter image description here

enter image description here

0

如果你想从0数据显示到30秒只有您可以地块只有这样的:

idcs=Xdata <30; %# find indices where X is less than 30s 
plot(Xdata(idcs),Ydata(idcs),'b'); %#plot only these data. 

或者你可以表达XLim其上的身影。

plot(Xdata,Ydata,'b'); %# plot everything 
set(gca,XLim,[0 30]); %# limit display on X axis 
+0

我不想只有0-30,我想要显示所有的数据。 – ddayan