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

3 visualizaciones (últimos 30 días)
Octavian
Octavian el 25 de Feb. de 2015
Editada: Octavian el 25 de Feb. de 2015
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.

Respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by