All I want to do is make the width greater and the height smaller. I'm just doing raster plots but this question applies to any MATLAB figure
. I can manually resize it using the figure directly when it's created but I want the program to spit it out in the right size to start with.
figure(figsize=(1,1)) would create an inch-by-inch image, which would be 80-by-80 pixels unless you also give a different dpi argument. If you've already got the figure created, say it's 'figure 1' (that's the default one when you're using pyplot), you can use figure(num=1, figsize=(8, 6), ...) to change it's size etc.
figsize() takes two parameters- width and height (in inches). By default the values for width and height are 6.4 and 4.8 respectively. Where, x and y are width and height respectively in inches.
The properties that can be set for a figure
is referenced here.
You could then use:
figure_number = 1; x = 0; % Screen position y = 0; % Screen position width = 600; % Width of figure height = 400; % Height of figure (by default in pixels) figure(figure_number, 'Position', [x y width height]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With