How to use ResizeFcn to normalize MarkerSize (plot3) and FontSize (text)?

조회 수: 1 (최근 30일)
Octavian
Octavian 2015년 2월 25일
편집: Octavian 2015년 2월 25일
Dear All,
I have a figure containing several linked objects (a plot3 surface, a plot3 set of 3D points, and a set of associated text labels), the latter two plotted in a for loop as they are linked. Here is the relevant code:
...
h1=plot(surface...);
for j = 1:length(points)
h2=plot3(points(j,1),points(j,2),points(j,3),...,'MarkerSize',x);
hold on
h3=text(points(j,1),points(j,2),points(j,3),...,num2str(Text(j)));
set(h3,'FontSize',y,...);
...
I want to normalize x and y to figure axes (say ax) sizes (1) and dynamically adapt them to ax size changes (2). I was suggested to use ResizeFcn, but I got stuck. Here are my trials for (1):
...
ax=gca;
curunits = get(ax, 'Units');
set(ax, 'Units', 'Points');
% pos_ax=get(ax,'Position');
set(ax, 'Units', curunits);
relativesize = 0.05;
set(h2,'MarkerSize', pos_ax(3)*relativesize);
set(h3,'FontSize', pos_ax(3)*relativesize);
...
How do I use ResizeFcn here to reflect changes in ax size? Your help is greatly appreciated, as always,
Octavian
I use matlab13b, and it looks lize SizeChangedFcn is not an option.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by