MATLAB Answers

Making the Y-axis a scale of a specific variable

8 views (last 30 days)
Thinker
Thinker on 5 Dec 2019
Answered: the cyclist on 5 Dec 2019
How to change the scale of values of the y-axis to a scalar multiple of a specific variable? (i.e. I want to make all values that appear on the y-axis scale as scalar multiples of a varaible "r"). Thank you.

  0 Comments

Sign in to comment.

Accepted Answer

the cyclist
the cyclist on 5 Dec 2019
Here is one way:
r = 7;
m = 50;
N = 50;
x = rand(N,1);
y = m*rand(N,1);
figure
plot(x,y,'.');
set(gca,'YTick',0:r:max(y),'YTickLabel',0:r:max(y))
Screen Shot 2019-12-05 at 2.49.58 PM.png

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by