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

Skip to content

Commit 141e16b

Browse files
committed
applied rest of barh patches
svn path=/trunk/matplotlib/; revision=2516
1 parent f0be66e commit 141e16b

4 files changed

Lines changed: 38 additions & 7 deletions

File tree

API_CHANGES

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
barh: x and y args have been renamed to width and bottom
2+
respectively, and their order has been swapped to maintain
3+
a (position, value) order.
4+
5+
bar and barh: now accept kwarg 'edgecolor'.
6+
7+
bar and barh: The left, height, width and bottom args can
8+
now all be scalars or sequences; see docstring.
9+
10+
barh: now defaults to edge aligned instead of center
11+
aligned bars
12+
13+
bar, barh and hist: Added a keyword arg 'align' that
14+
controls between edge or center bar alignment.
15+
116
Collections: PolyCollection and LineCollection now accept
217
vertices or segments either in the original form [(x,y),
318
(x,y), ...] or as a 2D numerix array, with X as the first column

CHANGELOG

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2006-06-22 Various changes to bar(), barh(), and hist().
2+
Added 'edgecolor' keyword arg to bar() and barh().
3+
The x and y args in barh() have been renamed to width
4+
and bottom respectively, and their order has been swapped
5+
to maintain a (position, value) order ala matlab. left,
6+
height, width and bottom args can now all be scalars or
7+
sequences. barh() now defaults to edge alignment instead
8+
of center alignment. Added a keyword arg 'align' to bar(),
9+
barh() and hist() that controls between edge or center bar
10+
alignment. Fixed ignoring the rcParams['patch.facecolor']
11+
for bar color in bar() and barh(). Fixed ignoring the
12+
rcParams['lines.color'] for error bar color in bar()
13+
and barh(). Fixed a bug where patches would be cleared
14+
when error bars were plotted if rcParams['axes.hold']
15+
was False. - MAS
16+
117
2006-06-22 Added support for numerix 2-D arrays as alternatives to
218
a sequence of (x,y) tuples for specifying paths in
319
collections, quiver, contour, pcolor, transforms.

examples/barh_demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# make a horizontal bar chart
33

44
from pylab import *
5-
x = 3+10*rand(5) # the bar lengths
6-
y = arange(5)+.5 # the bar centers on the y axis
5+
val = 3+10*rand(5) # the bar lengths
6+
pos = arange(5)+.5 # the bar centers on the y axis
77

88
figure(1)
9-
barh(x,y)
10-
yticks(y, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
9+
barh(pos,val, align='center')
10+
yticks(pos, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
1111
xlabel('Perfomance')
1212
title('How fast do you want to go today?')
1313
grid(True)
1414

1515
figure(2)
16-
barh(x,y, xerr=rand(5))
17-
yticks(y, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
16+
barh(pos,val, xerr=rand(5), align='center')
17+
yticks(pos, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
1818
xlabel('Perfomance')
1919

2020
show()

examples/simple3d_oo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import matplotlib
44
matplotlib.use('WXAgg')
5-
matplotlib.rcParams['numerix'] = 'numpy'
5+
matplotlib.rcParams['numerix'] = 'numarray'
66

77
from wxPython.wx import *
88
import matplotlib.axes3d

0 commit comments

Comments
 (0)