How can I specify a different set of positions for BOXPLOT labels in Statistics Toolbox 7.2 (R2009b)?
3 views (last 30 days)
Show older comments
When I try to specify new positions for X-axis labels of a boxplot, I see that labels are mispositioned when I print the figure to a different format.
Accepted Answer
MathWorks Support Team
on 9 Sep 2013
The ability to support user-defined positions for a BOXPLOT is not available in Statistics Toolbox 7.2 (R2009b).
The listener objects attached to the plot update the plot with adjusted positions when printing. The assumption here is that the original positions of the labels are not changed. However, if the original label positions are modified by the user, he can either delete the listener object or disable them before printing, so that an incorrect updating step does not occur:
ax = findobj(gcf,'type','axes')
for j=1:length(ax)
boxparent = getappdata(ax(j),'boxplothandle');
listeners = getappdata(boxparent,'boxlisteners');
% To disable the listener objects:
cellfun(@(x) set(x,'Enabled','off'), listeners)
% To delete:
% cellfun(@(x) delete(x), listeners)
end
Please note that the above script assumes 'gcf' returns the handle to the figure containing boxplots.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!