Settin spacing between Y-axis

3 views (last 30 days)
Paul Purdon
Paul Purdon on 29 May 2020
Commented: Ameer Hamza on 29 May 2020
Hi,
My x axis goes from 0 to 20 and my why from 0 to 100,
I would like both my axes to be the same length, so when my x axis increases by 1, my Y increases by 5.
How would I do that?

Answers (1)

Ameer Hamza
Ameer Hamza on 29 May 2020
Edited: Ameer Hamza on 29 May 2020
Use daspect()
plot(rand(1,10)*10);
daspect([1 5 1]) % 1 unit of x-axis is equal to 5 units of y-axis
Alternatively, try
plot(rand(1,10)*10);
axis square
  2 Comments
Rik
Rik on 29 May 2020
Great minds think alike? ;)

Sign in to comment.

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!