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

1 次查看(过去 30 天)
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