How do I create boxplots of defined size?
3 views (last 30 days)
Show older comments
Hello!
I know that the total size of a figure can be determined by setting the 'PaperSize' and 'PaperPosition' properties. The size of the plots as they are framed by the axes can be adjusted by drawing axes with defined position.
axes('Position',[left bottom width height]);
However, I have found that this does not work for boxplots, i.e. boxplots cannot be drawn in predefined axes - as soon as the boxplot command is called, matlab draws new axes of different position. Can anyone tell me how I can obtain boxplots of defined size?
PS: the axes defined in boxplot(axes('Position',[left bottom width height]),data) are also overruled by the boxplot routine, so this is also not a solution.
Thanks, Franzi
3 Comments
Answers (1)
Sean de Wolski
on 24 Oct 2012
Edited: Sean de Wolski
on 24 Oct 2012
If you go to the documentation for boxplot:
doc boxplot
The third options is:
- boxplot(axes,X,...)
Here you specify the axes handle on which to plot the boxplot:
hAx = axes(blah blah blah);
boxplot(hAx,blah blah blah);
More
In that case, manually resize the axes after creating the boxplot:
ax = findall(gcf,'type','axes');
set(ax(2),'position',[0.1/xSize 0.1/ySize 2.3/xSize 2.3/ySize])
0 Comments
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!