Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e79a0bb

Browse files
committed
Update docs, examples, for new color kwarg in hist.
svn path=/trunk/matplotlib/; revision=8220
1 parent 2c127a6 commit e79a0bb

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
2010-03-24 refactor colorbar code so that no cla() is necessary when
1+
2010-04-03 Added color kwarg to Axes.hist(), based on work by
2+
Jeff Klukas. - EF
3+
4+
2010-03-24 refactor colorbar code so that no cla() is necessary when
25
mappable is changed. -JJL
36

4-
2010-03-22 fix incorrect rubber band during the zoom mode when mouse
7+
2010-03-22 fix incorrect rubber band during the zoom mode when mouse
58
leaves the axes. -JJL
69

710
2010-03-21 x/y key during the zoom mode only changes the x/y limits. -JJL

doc/api/api_changes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ list may help describe what changes may be necessary in your code.
1010
Changes beyond 0.99.x
1111
=====================
1212

13+
* The :meth:`matplotlib.axes.Axes.hist` *color* kwarg now accepts
14+
a sequence of color specs to match a sequence of datasets.
15+
1316
* The :class:'~matplotlib.collections.EllipseCollection' has been
1417
changed in two ways:
1518

@@ -19,7 +22,7 @@ Changes beyond 0.99.x
1922

2023
+ The *height* and *width* kwargs have been changed to specify
2124
the height and width, again for consistency with
22-
:class:'~matplotlib.patches.Ellipse`, and to better match
25+
:class:`~matplotlib.patches.Ellipse`, and to better match
2326
their names; previously they specified the half-height and
2427
half-width.
2528

examples/pylab_examples/histogram_demo_extended.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,18 @@
6363

6464
#
6565
# histogram has the ability to plot multiple data in parallel ...
66+
# Note the new color kwarg, used to override the default, which
67+
# uses the line color cycle.
6668
#
6769
P.figure()
6870

6971
# create a new data-set
7072
x = mu + sigma*P.randn(1000,3)
7173

72-
n, bins, patches = P.hist(x, 10, normed=1, histtype='bar')
74+
n, bins, patches = P.hist(x, 10, normed=1, histtype='bar',
75+
color=['crimson', 'burlywood', 'chartreuse'],
76+
label=['Crimson', 'Burlywood', 'Chartreuse'])
77+
P.legend()
7378

7479
#
7580
# ... or we can stack the data

0 commit comments

Comments
 (0)