SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] More useful return values for boxplot

From: Jouni K S. <jk...@ik...> - 2006年01月19日 20:14:42
Hi,
I just read in another thread that the recommended way to submit
patches is to both post them here and on the Sourceforge tracker. 
Here's one that I had only posted on the tracker a while ago but that
still seems to apply cleanly to current cvs. It fixes a bug in my
previous boxplot patch (division by zero if you only plot one box),
and changes the return value of boxplot so that you can modify the
different parts of the plot separately, as suggested in John's
commentary to David Haas's original boxplot patch. Here's an example:
In [1]:boxplot(rand(100,2))
Out[1]:
{'boxes': [<matplotlib.lines.Line2D instance at 0x2deaaa8>,
 <matplotlib.lines.Line2D instance at 0x2deae68>],
 'caps': [<matplotlib.lines.Line2D instance at 0x2deaaf8>,
 <matplotlib.lines.Line2D instance at 0x2deab70>,
 <matplotlib.lines.Line2D instance at 0x2dea8f0>,
 <matplotlib.lines.Line2D instance at 0x2def170>],
 'fliers': [<matplotlib.lines.Line2D instance at 0x2dead00>,
 <matplotlib.lines.Line2D instance at 0x2deab48>,
 <matplotlib.lines.Line2D instance at 0x2def2b0>,
 <matplotlib.lines.Line2D instance at 0x2def148>],
 'medians': [<matplotlib.lines.Line2D instance at 0x2deaa58>,
 <matplotlib.lines.Line2D instance at 0x2def210>],
 'whiskers': [<matplotlib.lines.Line2D instance at 0x2dea8a0>,
 <matplotlib.lines.Line2D instance at 0x2dea9b8>,
 <matplotlib.lines.Line2D instance at 0x2deae90>,
 <matplotlib.lines.Line2D instance at 0x2deafd0>]}
In [2]:setp(Out[1]['medians'], 'linewidth', 3)
Out[2]:[None, None]
The patch also changes the boxplot demo to demonstrate this.
-- 
Jouni

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /