Adjust my Figure Size

조회 수: 9 (최근 30일)
Tertius Poolman
Tertius Poolman 2020년 11월 27일
답변: Sulaymon Eshkabilov 2020년 11월 27일
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);

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 11월 27일
You'd need to adjust your figure window (POsition, location and drawable area) sizes, respectively.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by