<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254</link>
    <title>MATLAB Central Newsreader - boxplot</title>
    <description>Feed for thread: boxplot</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 14 Nov 2008 14:50:03 -0500</pubDate>
      <title>boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#610916</link>
      <author>Thamar van Esch</author>
      <description>Is there a way to control the y-axis features in boxplot? I would like to change the label ('Values' is default) and set the scale manually, but the regular 'set(gca,...)' does not work for boxplot.&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Fri, 14 Nov 2008 17:54:47 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#610946</link>
      <author>Michael</author>
      <description>On Nov 14, 6:50=A0am, &quot;Thamar van Esch&quot; &amp;lt;thamarvane...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Is there a way to control the y-axis features in boxplot? I would like to=&lt;br&gt;
&amp;nbsp;change the label ('Values' is default) and set the scale manually, but the=&lt;br&gt;
&amp;nbsp;regular 'set(gca,...)' does not work for boxplot.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&lt;br&gt;
a=3D[1;2;3]&lt;br&gt;
ah=3Daxes&lt;br&gt;
boxplot(a)&lt;br&gt;
ylabel(ah,'These are my values')</description>
    </item>
    <item>
      <pubDate>Mon, 17 Nov 2008 08:28:02 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611242</link>
      <author>Pekka Kumpulainen</author>
      <description>&quot;Thamar van Esch&quot; &amp;lt;thamarvanesch@gmail.com&amp;gt; wrote in message &amp;lt;gfk36r$bca$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Is there a way to control the y-axis features in boxplot? I would like to change the label ('Values' is default) and set the scale manually, but the regular 'set(gca,...)' does not work for boxplot.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&lt;br&gt;
What is it exactly that doesn't work?&lt;br&gt;
At least these do work:&lt;br&gt;
boxplot(randn(100,3))&lt;br&gt;
set(gca,'YLim',[-5 5], ...)&lt;br&gt;
'YTick',[-2 0 2], ...&lt;br&gt;
'YTickLabel',{'L-2' 'L0' 'L2'});</description>
    </item>
    <item>
      <pubDate>Mon, 17 Nov 2008 17:40:17 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611324</link>
      <author>Lars Barring</author>
      <description>&quot;Pekka Kumpulainen&quot; &amp;lt;pekka.nospam.kumpulainen@tut.please.fi&amp;gt; wrote i&lt;br&gt;
&amp;gt; &quot;Thamar van Esch&quot; &amp;lt;thamarvanesch@gmail.com&amp;gt; wrote&lt;br&gt;
&amp;gt; &amp;gt; Is there a way to control the y-axis features in boxplot? I would like to change the &lt;br&gt;
&amp;gt; &amp;gt; label ('Values' is default) and set the scale manually, but the regular 'set(gca,...)' &lt;br&gt;
&amp;gt; &amp;gt; does not work for boxplot.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What is it exactly that doesn't work?&lt;br&gt;
&amp;gt; At least these do work:&lt;br&gt;
&amp;gt; boxplot(randn(100,3))&lt;br&gt;
&amp;gt; set(gca,'YLim',[-5 5], ...)&lt;br&gt;
&amp;gt; 'YTick',[-2 0 2], ...&lt;br&gt;
&amp;gt; 'YTickLabel',{'L-2' 'L0' 'L2'});&lt;br&gt;
&lt;br&gt;
Well, I do not know specifically about the y axis labels but I had the same &lt;br&gt;
experience with x axis labels. Maybe you were trying to have horizontal boxes?&lt;br&gt;
&lt;br&gt;
Whichever, this is my experience:&lt;br&gt;
After considerable investigations it turned out that the x axis labels in my plot were &lt;br&gt;
not actually x axis labels (in the ordinary sense), but rather text object that are &lt;br&gt;
children to the &quot;boxplot&quot; hggroup (the normal x axis labels were just turned &lt;br&gt;
off/empty). This is somehow controlled through a setappdata structure that I did not &lt;br&gt;
really bother to analyse in detail. Then there were listeners that sort of prevented &lt;br&gt;
me from adding normal x axis labels but instead directed some (but not all) of the &lt;br&gt;
adjustments that I was trying to do to these text object. &lt;br&gt;
&lt;br&gt;
To cut a long and boring story short, I spent something like six hours (!!) of &lt;br&gt;
concentrated work on creating a something like a publication quality boxplot &lt;br&gt;
because of the most unintuitive construction of the boxplot object.&lt;br&gt;
&lt;br&gt;
And, to try to draw some general conclusion out of this experience, this is not the &lt;br&gt;
first time that I find Matlab plot objects difficult because of more or less hidden &lt;br&gt;
'functionality' (bug or feature??). Another example is the colorbar issue where &lt;br&gt;
attempts to make it nice and always well placed and scaled directly interfere with &lt;br&gt;
the possibility to tailor the layout to specific need.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Lars</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 10:33:01 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611455</link>
      <author>Pekka Kumpulainen</author>
      <description>&quot;Lars Barring&quot; &amp;lt;lars.barring@myworkplace.se&amp;gt; wrote in message &amp;lt;gfsaa1$g5q$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Pekka Kumpulainen&quot; &amp;lt;pekka.nospam.kumpulainen@tut.please.fi&amp;gt; wrote i&lt;br&gt;
&amp;gt; &amp;gt; &quot;Thamar van Esch&quot; &amp;lt;thamarvanesch@gmail.com&amp;gt; wrote&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Is there a way to control the y-axis features in boxplot? I would like to change the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; label ('Values' is default) and set the scale manually, but the regular 'set(gca,...)' &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; does not work for boxplot.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; What is it exactly that doesn't work?&lt;br&gt;
&amp;gt; &amp;gt; At least these do work:&lt;br&gt;
&amp;gt; &amp;gt; boxplot(randn(100,3))&lt;br&gt;
&amp;gt; &amp;gt; set(gca,'YLim',[-5 5], ...)&lt;br&gt;
&amp;gt; &amp;gt; 'YTick',[-2 0 2], ...&lt;br&gt;
&amp;gt; &amp;gt; 'YTickLabel',{'L-2' 'L0' 'L2'});&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Well, I do not know specifically about the y axis labels but I had the same &lt;br&gt;
&amp;gt; experience with x axis labels. Maybe you were trying to have horizontal boxes?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Whichever, this is my experience:&lt;br&gt;
&amp;gt; After considerable investigations it turned out that the x axis labels in my plot were &lt;br&gt;
&amp;gt; not actually x axis labels (in the ordinary sense), but rather text object that are &lt;br&gt;
&amp;gt; children to the &quot;boxplot&quot; hggroup (the normal x axis labels were just turned &lt;br&gt;
&amp;gt; off/empty). This is somehow controlled through a setappdata structure that I did not &lt;br&gt;
&amp;gt; really bother to analyse in detail. Then there were listeners that sort of prevented &lt;br&gt;
&amp;gt; me from adding normal x axis labels but instead directed some (but not all) of the &lt;br&gt;
&amp;gt; adjustments that I was trying to do to these text object. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; To cut a long and boring story short, I spent something like six hours (!!) of &lt;br&gt;
&amp;gt; concentrated work on creating a something like a publication quality boxplot &lt;br&gt;
&amp;gt; because of the most unintuitive construction of the boxplot object.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; And, to try to draw some general conclusion out of this experience, this is not the &lt;br&gt;
&amp;gt; first time that I find Matlab plot objects difficult because of more or less hidden &lt;br&gt;
&amp;gt; 'functionality' (bug or feature??). Another example is the colorbar issue where &lt;br&gt;
&amp;gt; attempts to make it nice and always well placed and scaled directly interfere with &lt;br&gt;
&amp;gt; the possibility to tailor the layout to specific need.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Lars&lt;br&gt;
&lt;br&gt;
OK, this clears the situation. &lt;br&gt;
Yes, boxplot is one of those &quot;nice&quot; creatures who do a lot of things inside.&lt;br&gt;
Legend is another one, I really burned my sleeves with it some time ago. Extremely slow, usually in wrong place, unnecessary line and text objects created inside. I wrote my own for that purpose (several releases ago).&lt;br&gt;
&lt;br&gt;
You can give the labels in call&lt;br&gt;
h=boxplot(...'Labels',...)&lt;br&gt;
h will be a matrix of handles to the line objects (not mentioned in documentation)&lt;br&gt;
The line objects also have tags that can be used to find their handles. &lt;br&gt;
But the Labels have no tag. You can find their handles among the children of the hggroup object, which is the only child of the axis:&lt;br&gt;
&amp;nbsp;hcc = get(get(gca,'Children'),'Children');&lt;br&gt;
Usually the lables are the first ones (in reverse order from right to left). The only ones of type text anyway: hl = findobj(hcc,'type','text')&lt;br&gt;
Now you can set their properties.&lt;br&gt;
&lt;br&gt;
One reason why they use separate text objects instead of XTickLabels (or Y..) might be that tixklabels dont support tex or rotating, which is an option in boxplot.&lt;br&gt;
But yes, could be more clear. However most things can be specified in the input arguments of boxplot.</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 17:22:02 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611573</link>
      <author>Lars Barring</author>
      <description>&quot;Pekka Kumpulainen&quot; &amp;lt;pekka.nospam.kumpulainen@tut.please.fi&amp;gt; wrote ...&lt;br&gt;
&amp;gt; &quot;Lars Barring&quot; &amp;lt;lars.barring@myworkplace.se&amp;gt; wrote ...&lt;br&gt;
...&lt;br&gt;
&amp;gt; One reason why they use separate text objects instead of XTickLabels (or Y..) &lt;br&gt;
&amp;gt; might be that tixklabels dont support tex or rotating, which is an option in boxplot.&lt;br&gt;
&amp;gt; But yes, could be more clear. However most things can be specified in the input &lt;br&gt;
&amp;gt; arguments of boxplot.&lt;br&gt;
&lt;br&gt;
I wanted to have the x ticks not rotated 90 degrees but slanting at 40-60 &lt;br&gt;
degrees. Which I normally achieve with the excellent FEX routine ROTATETICKLABEL.&lt;br&gt;
And I wanted my labels to include TeX formatting (Greek letters as subscripts). &lt;br&gt;
Both to which the BOXPLOT &quot;x-labels&quot; were completely indifferent. Well, I &lt;br&gt;
digged deep enough to come up with this solution &lt;br&gt;
&lt;br&gt;
hA=subplot(2,2,1);&lt;br&gt;
boxplot(c(L,1:n1))&lt;br&gt;
set(hA,'FontSize',11,'YLim',[ymin 1],'Position',[0.08 0.62 0.39 0.32]);&lt;br&gt;
hB=findobj(hA,'Type','hggroup');&lt;br&gt;
hL=findobj(hB,'Type','text');&lt;br&gt;
delete(hL)&lt;br&gt;
set(gca,'XTick',[1:n1]);&lt;br&gt;
set(gca,'XTickLabel',IXName');&lt;br&gt;
hT=rotateticklabel(gca,-30);&lt;br&gt;
for k=1:n1,&lt;br&gt;
&amp;nbsp;&amp;nbsp;set(hT(k),'FontSize',11,'Position',[k ymin*dd 0]);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
The rather &quot;interesting&quot; but counterintuitive result of this tweak is &lt;br&gt;
that I get a plot that looks as I want, *but* the x-tick labels (i.e the &lt;br&gt;
hT text objects) are still children under the BOXPLOT hggroup. &lt;br&gt;
Bug or feature???? &lt;br&gt;
&lt;br&gt;
I am sure that there is a perfectly valid explanation to this behaviour&lt;br&gt;
(along the lines you mention; rotation etc). But what really beats me is &lt;br&gt;
why this is implemented in this rather unintuitive, inconsistent with other&lt;br&gt;
plot functions, and totally undocumented and difficult to find way [sorry about&lt;br&gt;
all these un- and in- words but I spent some 6 hours on this, including finding &lt;br&gt;
a useful dd vertical displacement of the text]. &lt;br&gt;
&lt;br&gt;
TMW: why not just do the right thing and make the axis labels available as &lt;br&gt;
children to the axes object with some nice and useful defaults ??&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Lars</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 18:34:02 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611607</link>
      <author>Pekka Kumpulainen</author>
      <description>&quot;Lars Barring&quot; &amp;lt;lars.barring@myworkplace.se&amp;gt; wrote in message &amp;lt;gfutjq$6q7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Pekka Kumpulainen&quot; &amp;lt;pekka.nospam.kumpulainen@tut.please.fi&amp;gt; wrote ...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Lars Barring&quot; &amp;lt;lars.barring@myworkplace.se&amp;gt; wrote ...&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; One reason why they use separate text objects instead of XTickLabels (or Y..) &lt;br&gt;
&amp;gt; &amp;gt; might be that tixklabels dont support tex or rotating, which is an option in boxplot.&lt;br&gt;
&amp;gt; &amp;gt; But yes, could be more clear. However most things can be specified in the input &lt;br&gt;
&amp;gt; &amp;gt; arguments of boxplot.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I wanted to have the x ticks not rotated 90 degrees but slanting at 40-60 &lt;br&gt;
&amp;gt; degrees. Which I normally achieve with the excellent FEX routine ROTATETICKLABEL.&lt;br&gt;
&amp;gt; And I wanted my labels to include TeX formatting (Greek letters as subscripts). &lt;br&gt;
&amp;gt; Both to which the BOXPLOT &quot;x-labels&quot; were completely indifferent. Well, I &lt;br&gt;
&amp;gt; digged deep enough to come up with this solution &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; hA=subplot(2,2,1);&lt;br&gt;
&amp;gt; boxplot(c(L,1:n1))&lt;br&gt;
&amp;gt; set(hA,'FontSize',11,'YLim',[ymin 1],'Position',[0.08 0.62 0.39 0.32]);&lt;br&gt;
&amp;gt; hB=findobj(hA,'Type','hggroup');&lt;br&gt;
&amp;gt; hL=findobj(hB,'Type','text');&lt;br&gt;
&amp;gt; delete(hL)&lt;br&gt;
&amp;gt; set(gca,'XTick',[1:n1]);&lt;br&gt;
&amp;gt; set(gca,'XTickLabel',IXName');&lt;br&gt;
&amp;gt; hT=rotateticklabel(gca,-30);&lt;br&gt;
&amp;gt; for k=1:n1,&lt;br&gt;
&amp;gt;   set(hT(k),'FontSize',11,'Position',[k ymin*dd 0]);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The rather &quot;interesting&quot; but counterintuitive result of this tweak is &lt;br&gt;
&amp;gt; that I get a plot that looks as I want, *but* the x-tick labels (i.e the &lt;br&gt;
&amp;gt; hT text objects) are still children under the BOXPLOT hggroup. &lt;br&gt;
&amp;gt; Bug or feature???? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am sure that there is a perfectly valid explanation to this behaviour&lt;br&gt;
&amp;gt; (along the lines you mention; rotation etc). But what really beats me is &lt;br&gt;
&amp;gt; why this is implemented in this rather unintuitive, inconsistent with other&lt;br&gt;
&amp;gt; plot functions, and totally undocumented and difficult to find way [sorry about&lt;br&gt;
&amp;gt; all these un- and in- words but I spent some 6 hours on this, including finding &lt;br&gt;
&amp;gt; a useful dd vertical displacement of the text]. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; TMW: why not just do the right thing and make the axis labels available as &lt;br&gt;
&amp;gt; children to the axes object with some nice and useful defaults ??&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Lars&lt;br&gt;
&lt;br&gt;
Why not simply modify the existing text objects? You have the handles in hL, &lt;br&gt;
set(hL,'Rotation',30,'Interpreter','latex')&lt;br&gt;
&lt;br&gt;
Ticklabels are special creatures and you are definitely not the only one wishing they would some day support the full set of text object properties, or even close...</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 20:09:02 -0500</pubDate>
      <title>Re: boxplot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239254#611627</link>
      <author>Lars Barring</author>
      <description>&quot;Pekka Kumpulainen&quot; &amp;lt;pekka.nospam.kumpulainen@tut.please.fi&amp;gt; wrote in message &lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt; SNIP&lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt; And I wanted my labels to include TeX formatting (Greek letters as subscripts). &lt;br&gt;
&amp;gt; &amp;gt; Both to which the BOXPLOT &quot;x-labels&quot; were completely indifferent. Well, I &lt;br&gt;
&amp;gt; &amp;gt; digged deep enough to come up with this solution &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; hA=subplot(2,2,1);&lt;br&gt;
&amp;gt; &amp;gt; boxplot(c(L,1:n1))&lt;br&gt;
&amp;gt; &amp;gt; set(hA,'FontSize',11,'YLim',[ymin 1],'Position',[0.08 0.62 0.39 0.32]);&lt;br&gt;
&amp;gt; &amp;gt; hB=findobj(hA,'Type','hggroup');&lt;br&gt;
&amp;gt; &amp;gt; hL=findobj(hB,'Type','text');&lt;br&gt;
&amp;gt; &amp;gt; delete(hL)&lt;br&gt;
&amp;gt; &amp;gt; set(gca,'XTick',[1:n1]);&lt;br&gt;
&amp;gt; &amp;gt; set(gca,'XTickLabel',IXName');&lt;br&gt;
&amp;gt; &amp;gt; hT=rotateticklabel(gca,-30);&lt;br&gt;
&amp;gt; &amp;gt; for k=1:n1,&lt;br&gt;
&amp;gt; &amp;gt;   set(hT(k),'FontSize',11,'Position',[k ymin*dd 0]);&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The rather &quot;interesting&quot; but counterintuitive result of this tweak is &lt;br&gt;
&amp;gt; &amp;gt; that I get a plot that looks as I want, *but* the x-tick labels (i.e the &lt;br&gt;
&amp;gt; &amp;gt; hT text objects) are still children under the BOXPLOT hggroup. &lt;br&gt;
&amp;gt; &amp;gt; Bug or feature???? &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; SNIP &lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; Why not simply modify the existing text objects? You have the handles in hL, &lt;br&gt;
&amp;gt; set(hL,'Rotation',30,'Interpreter','latex')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Ticklabels are special creatures and you are definitely not the only one wishing &lt;br&gt;
&amp;gt; they would some day support the full set of text object properties, or even &lt;br&gt;
&amp;gt; close...&lt;br&gt;
&lt;br&gt;
Well, maybe I did something wrong in all the test and trials I had to experiment &lt;br&gt;
with. But when I tried that, the text object did not react. They just stayed either &lt;br&gt;
horizontal or vertical, and LaTeX was not accepted .... What I believe my code did was to create the text objects (with the right interpreter turned on and rotated &lt;br&gt;
to my taste) and as such they were then hooked up as label children to the &lt;br&gt;
BOXPLOT hggroup.&lt;br&gt;
&lt;br&gt;
Lars</description>
    </item>
  </channel>
</rss>

