How to set the length of axis in figures?

6 views (last 30 days)
kaichuan zhu
kaichuan zhu on 24 Oct 2020
Answered: Ameer Hamza on 24 Oct 2020
Hi
Can anyone tell me how to set the length of axis in figures?
For example, i want to set x axis as 3cm and y axis as 6 cm.
Thanks a lot!

Answers (1)

Ameer Hamza
Ameer Hamza on 24 Oct 2020
The lengths in cm are only relevant when you print the figure. If you just want to control the aspect ratio, then you can use pbaspect()
ax = axes;
pbaspect(ax, [1 2 1])

Categories

Find more on 2-D and 3-D Plots 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!