From: <jd...@us...> - 2008-06-10 15:54:00
|
Revision: 5462 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5462&view=rev Author: jdh2358 Date: 2008-06-10 08:53:19 -0700 (Tue, 10 Jun 2008) Log Message: ----------- fixed auto-legend wart for bar and friends Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-10 15:50:55 UTC (rev 5461) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-10 15:53:19 UTC (rev 5462) @@ -5773,6 +5773,16 @@ #fig.savefig('histogram_demo',dpi=72) plt.show() + + You can use labels for your histogram, and only the first + Rectangle gets the label (the others get the magic string + '_nolegend_'. This will make the histograms work in the + intuitive way for bar charts:: + + ax.hist(10+2*np.random.randn(1000), label='men') + ax.hist(12+3*np.random.randn(1000), label='women', alpha=0.5) + ax.legend() + """ if not self._hold: self.cla() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |