0

I have some datas, say from [0.1:0.1:0.9]+[1:1:10].

If I use scatter to plot it, it looks like this.

enter image description here

However, it want the points equally distribute along the axis, anyone can tell me how to do it? What I mean is the distance between data points in [0.1-0.9] are the same with [1-10] on the graph respect to x-axis.

4

1 回答 1

1

如果您的数据包含在向量xy中,请使用

plot(y,'o')

而不是plot(x,y,'o')or scatter(x,y)

如果要标记x轴,请使用类似

set(gca,'xtick',1:length(y),'xticklabel',[.1:.1:.9 1:10])

或者您可能需要标签的子集,例如:

set(gca,'xtick',1:2:length(y),'xticklabel',[.1:.2:.9 2:2:10])
于 2013-10-04T15:21:47.093 回答