MATLAB Answers


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

Asked by Octavian on 25 Feb 2015
Latest activity Edited by Octavian on 25 Feb 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:
for j = 1:length(points)
hold on
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):
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,
I use matlab13b, and it looks lize SizeChangedFcn is not an option.


Sign in to comment.

0 Answers