Increase figure size in livescript
258 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to know how I can increase the size of a graph in a livescript. My teacher shared a livescript with us and the size of the graph looks big and he doesn't use any command to increase the size, but when I run the livescript the size decreases. In the first figure, the graph looks big and the second figure, after executing the livescript, the figure returns to its normal size.
0 commentaires
Réponses (1)
Adam Danz
le 3 Avr 2023
Modifié(e) : Adam Danz
le 4 Avr 2023
One way to change the figure size in a live script is to set the figure's width and height.
fig = figure();
fig.Position(3:4) = [width, height];
Another way is to set the default figure position which will affect all figures in and out of a live script.
set(groot, 'DefaultFigurePosition', [x,y,width,height])
% To reset:
% set(groot, 'DefaultFigurePosition', 'factory')
Lastly, if the live script re-uses the previous figure, figure size will be maintained.
3 commentaires
Adam Danz
le 4 Avr 2023
@Andhy, when I opened your mlx file I confirmed that your figures are a bit big. When I re-ran the script without changing anything, the new figures were smaller and closer to the expected size.
Did you try changing the DefaultFigurePosition size or did you check what your DefaultFigurePosition size is using set(groot,'DefaultFigurePosition')?
When I changed the default fig posiiton to [200 200 80 70] the mlx figures were very small as expected and when I changed the default fig positiion to [200 200 1000 1000] the mls figure were very large as expected.
If the figure are output on the right, their size should scale to the width of the right column.
Voir également
Catégories
En savoir plus sur Environment and Settings dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!