Change figure size without changing plot size
34 ビュー (過去 30 日間)
古いコメントを表示
Hello,
How can i change the size of a figure without changing the inside plot?
I want to create a large figure window with a small plot at a specific position (to make room for a slider for exmple)
Thanks
1 件のコメント
Adam
2022 年 9 月 7 日
編集済み: Adam
2022 年 9 月 7 日
If you mean you want to change the size of an existing figure without changing the size of a plot that is a little more complicated (but still involves the same idea as below, explicitly setting the axes properties).
But if you just want to create one then create the figure of whatever size you want, using the 'Position' property in the call to figure. Then do the same with the axes function, also using 'Position' (and also 'Parent') e.g.
hFig = figure( 'Position',... )
hAxes = axes( hFig, 'Position',... )
Depending if you want the axes to be fixed size or relative to the figure you can also change the 'Units' property of the axes between e.g. 'pixels' and 'normalized'
回答 (1 件)
vamshi sai yele
2022 年 9 月 14 日
Hi Tal,
As per my understanding you want to change the size of the figure without changing the inside plot.
I have tried to reproduce it from my end the solution attached bellow
x5=0:0.1:10;
x1 = x5*2
y1 = cos(x5)
x2 = x5*3
y2 = sin(x5)
a= figure;
b= axes(a,"Units","pixels","Position",[30 30 200 200])
plot(x5,y1)
Here, in this code, the dimensions of the inner plot is mentioned in [left bottom width height] fashion.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!