change the scale on graph
409 ビュー (過去 30 日間)
古いコメントを表示
I've been researching this a while and can't find what I need - I can change the limits on the axis for graphs etc without a problem, but what I need is to change the numbers on the scale, without actually changing the scale of the graph (not sure if I'm explaining right). So I have a pcolor plot, but wish to change the numbers on the axes, without changing the axes limits (So I still want to show the same data, but with the axes reading different values) - for example, the current values multiplied by a constant. Thanks
1 件のコメント
Veronica Lucchese
2019 年 2 月 27 日
編集済み: Veronica Lucchese
2019 年 2 月 27 日
In matlab, the scale is called the c-axis. In order to manipulate the scale, you must manipulate the c-axis values
type in the command window:
caxis([0 0.1]) or whatever you want you scale limits to be
採用された回答
Azzi Abdelmalek
2016 年 4 月 18 日
編集済み: Azzi Abdelmalek
2016 年 4 月 18 日
You mean to change the ticks of your axis. For example
x=0:10
y=cos(x)
plot(x,y)
number_of_ticks=5
xt=xlim
set(gca,'xtick',linspace(xt(1),xt(2),number_of_ticks))
10 件のコメント
その他の回答 (1 件)
Kelly Kearney
2016 年 4 月 18 日
You can simply change the YTickLabel property:
ax = axes;
plot(1:10)
ax.YTickLabel = strtrim(cellstr(num2str(2 * ax.YTick')))
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!