change the scale on graph

조회 수: 419 (최근 30일)
Jamie Shelley
Jamie Shelley 2016년 4월 18일
편집: Veronica Lucchese 2019년 2월 27일
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
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
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
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 18일
This works for me
Jamie Shelley
Jamie Shelley 2016년 4월 18일
I don't understand why it still won't work for me, I can't see what's wrong with it

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Kelly Kearney
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')))
  댓글 수: 1
Jamie Shelley
Jamie Shelley 2016년 4월 18일
Thanks, but that didn't work, it just deleted the plot from the figure

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by