Increase figure size in livescript
92 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Adam Danz
am 3 Apr. 2023
Bearbeitet: Adam Danz
am 4 Apr. 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 Kommentare
Adam Danz
am 4 Apr. 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.
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!