Increase figure size in livescript

133 次查看(过去 30 天)
Andhy
Andhy 2023-4-3
编辑: Adam Danz 2023-4-4
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.

回答(1 个)

Adam Danz
Adam Danz 2023-4-3
编辑:Adam Danz 2023-4-4
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 个评论
Andhy
Andhy 2023-4-3
I share the mlx file. It is observed that the images are large and no command is used to increase the size. I'm sorry if it's in Spanish, the important thing is the figure.
Adam Danz
Adam Danz 2023-4-4
@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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by