Adjust my Figure Size
19 ビュー (過去 30 日間)
古いコメントを表示
I'm plotting a figure and upon wanting to add text and and a textarrow, I realise I would want my actual figure to be displayed smaller on the screen to allow for the title and textarrow to display decently. Refer to the picture and my code below. Please point me in the right direction to adjust my figure size.

figure
hold on;
axis on;
SE505_NodesPlot(n1,'1',0.25,'ok');
SE505_NodesPlot(n2,'2',0.25,'ok');
SE505_NodesPlot(n3, '3', 0.25, 'ok');
SE505_NodesPlot(n4, '4', 0.25, 'ok');
SE505_NodesPlot(n5, '5', 0.25, 'ok');
SE505_NodesPlot(n6, '6', 0.25, 'ok');
SE505_NodesPlot(n7, '7', 0.25, 'ok');
SE505_NodesPlot(n8, '8', 0.25, 'ok');
SE505_NodesPlot(n9, '9', 0.25, 'ok');
SE505_NodesPlot(n10, '10', 0.25, 'ok');
SE505_LinesPlot(n1,n2,'k');
SE505_LinesPlot(n2,n4,'k');
SE505_LinesPlot(n3,n4,'k');
SE505_LinesPlot(n4,n6,'k');
SE505_LinesPlot(n5,n6,'k');
SE505_LinesPlot(n6,n8,'k');
SE505_LinesPlot(n7,n8,'k');
SE505_LinesPlot(n8,n10,'k');
SE505_LinesPlot(n9,n10,'k');
title('Testing')
set(get(gca,'title'),'Position',[8 6 1.00011])
annotation('textarrow' , [0.13 0.13],[1 0.8],'string','Test');
The Nodesplot and Linesplot command are as follows:
function y = SE505_NodesPlot(n,no,disp,sty)
% This function plots a node with coordinates n = [x;y], node number no and
% adds no above and to the right of each node with distance disp.
plot(n(1),n(2),sty,'linewidth',16 );
text(n(1)+disp,n(2)+disp, no, 'fontsize',24);
y = n;
function y = LinesPlot(n1,n2,sty)
x = [n1(1);n2(1)];
y = [n1(2);n2(2)];
plot(x,y, sty,'linewidth', 4);
0 件のコメント
回答 (1 件)
Sulaymon Eshkabilov
2020 年 11 月 27 日
You'd need to adjust your figure window (POsition, location and drawable area) sizes, respectively.
Here is the help doc: https://www.mathworks.com/help/matlab/ref/figure.html?searchHighlight=plot%20figure%20size&s_tid=srchtitle#bvjs6el-1
Another nice doc: https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html#d122e383283
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!