Matlab figures: Axes of same length (in points, cm, etc.)

5 views (last 30 days)
Dear colleagues,
how can I adjust the size of Matlab figures in such a way that the axes have the same height and width?
I am using the same axis limits and the command "set(groot,'defaultfigureposition',[100 100 750 750]);". However the figure axes still are longer in the vertical direction than in the horizontal direction.
Is there any possibility to properly set the figure or axes size of the same length?
Best regards,
Felix
  4 Comments
Adam Danz
Adam Danz on 9 Oct 2019
Note that default figure size units are pixels which aren't necessarily square so even if the width and height values are the same, that doesn't mean the figure's actual width and height are the same. Also, the "position" property of a figure sets the size of the drawable area. If you'd like square figures including the frame, you'd need to set the units to something not dependent on monitor size like inches or centimeters and then set the OuterPosition property.
figure('units','inches','OuterPosition', [2,2,4,4])
felix.b
felix.b on 10 Oct 2019
That is good and important to know. Thank you Adam!

Sign in to comment.

Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!