MATLAB Answers

how to set graph size

5,212 views (last 30 days)
Soni huu
Soni huu on 28 Feb 2013
Commented: Giuseppe on 25 Mar 2021
how to set my graphic size to (w:h=550:400) now my graph size is 560:420 (automatic)
[ day_number, daily_rain ] = DailyRain( RainData, 2010, 1);
andemande = plot( day_number, daily_rain,'-ok' );
day_numbermax = max(day_number);
day_numbermin = min(day_number);
grid on;
ylabel('Akumulasi Curah Hujan (mm)')
xlim([day_numbermin day_numbermax])
  1 Comment
Soni huu
Soni huu on 28 Feb 2013
code to set..

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 28 Feb 2013
Edited: MathWorks Support Team on 16 Mar 2021
Set the ‘Position’ property on the current figure (gcf). Specify the position as a vector of the form “[x0 y0 width height]”, where “x0” and “y0” define the distance from the lower-left corner of the screen to the lower-left corner of the figure. By default, the position is in pixels.
You can specify other units (inches, centimeters, normalized, points, or characters). For example:
You can also save a handle to your figure and set the Position property using dot notation:
f = figure;
f.Position = [10 10 550 400];
Giuseppe on 25 Mar 2021
Hi @Azzi Abdelmalek, if I want to change only "width" and "height", what are the default values of x0 and y0?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!