Hiya,
I want my figures to all be created in the same dimension. Currently my figures are the size of the window it opens in (which are usually quite small) and I have to stretch it out. Is there a way for them to open up a preset size?
Thanks
Yewande

 Réponse acceptée

Plus de réponses (1)

Joseph Cheng
Joseph Cheng le 21 Mai 2015
Use the set() function and parameters 'position' and 'units'.
%example:
figure;
set(gcf,'units','normalized','position',[0 0 1 1])
will make the figure window full sized

5 commentaires

Joseph Cheng
Joseph Cheng le 21 Mai 2015
other units can be set like 'pixel' to specifically set the number of pixels but i usually stay in normalized such that they get scaled depending on which computer or monitor setup i have.
Yewande Oni
Yewande Oni le 21 Mai 2015
Great this works a treat. But what if I have multiple figures, it doesn't seem to like that even though I have specified each figure as its own. It seems to merge the two figures together.
For example %figure(1) %set(gcf,'units','pixels','position',[54 321 1319 488]) %plot(x)
%figure(2) %set(gcf,'units','pixels','position',[54 321 1319 488]) %plot(y)
Joseph Cheng
Joseph Cheng le 21 Mai 2015
what do you mean merge the two figures together? for me it just stacks them on top of each other. do you want to tile the outputs so they are all displayed? thats what the first two entries in the position are. the 4 entries in the position (if you read) the documentation is [screen_x_position screen_y_position figure_width figure_height] where screen_position is the lower left corner of the window.
Yewande Oni
Yewande Oni le 21 Mai 2015
I want it to open each figure in a different window with the correct dimensions and at the moment it does not do that. It opens both figures in the same window.
Yewande Oni
Yewande Oni le 21 Mai 2015
It was an error my end I just needed to clear the workspace and run it again :)
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by