开发者

How do I rescale the X axis in MATLAB's plot function? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Changing scaling of MATLAB Figure

I have an m-size vector开发者_Go百科 f. By calling plot(f) MATLAB plots a graph of x=1..m as a function of f:

How do I rescale the X axis in MATLAB's plot function? [duplicate]

I would still like a graph of f as a function of 1..m, but I want the numbers on the x axis to be 5,15,25,...,95 (fake_x = 5:10:95).

In other words: I want the graph to be exactly the same (f as a function of x=1..m), but the x axis should be fake_x, not x.


set(gca,'XTick',[5 15 25 35 45 55 65 75 85 95])

Or something like this.

look up "tick" in the help documentation. the set(gca... function is very helpful in customizing plots.

hope this helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜