Skip to content

Commit 1d51b6b

Browse files
committed
small fixes recommended by reviews
1 parent 3f02159 commit 1d51b6b

34 files changed

+86
-80
lines changed

doc/users/whats_new.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ Ian Thomas added classes to perform interpolation within triangular grids
8080
the triangles in which points lie (
8181
:class:`~matplotlib.tri.TrapezoidMapTriFinder`).
8282

83+
Left and right side axes titles
84+
-------------------------------
85+
Andrew Dawson added the ability to add axes titles flush with the left and
86+
right sides of the top of the axes using a new keyword argument `loc` to
87+
:func:`~matplotlib.pyplot.title`.
88+
8389
.. _whats-new-1-2:
8490

8591
new in matplotlib-1.2

examples/pylab_examples/eventcollection_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@
5151
ax.set_title('line plot with data points')
5252

5353
# display the plot
54-
fig.show()
54+
plt.show()

examples/pylab_examples/eventplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
linelengths=linelengths2, orientation='vertical')
6565
ax2.set_title('vertical eventplot 2')
6666

67-
fig.show()
67+
plt.show()

lib/matplotlib/axes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
39203920
if len(colors) == 0:
39213921
colors = [None]
39223922

3923-
if len(lineoffsets) == 1:
3923+
if len(lineoffsets) == 1 and len(positions) != 1:
39243924
lineoffsets = np.tile(lineoffsets, len(positions))
39253925
lineoffsets[0] = 0
39263926
lineoffsets = np.cumsum(lineoffsets)
@@ -3935,20 +3935,20 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
39353935
linestyles = [linestyles] * len(positions)
39363936

39373937
if len(lineoffsets) != len(positions):
3938-
raise ValueError('lineoffsets and positions are unequal sized \
3939-
sequences')
3938+
raise ValueError('lineoffsets and positions are unequal sized '
3939+
'sequences')
39403940
if len(linelengths) != len(positions):
3941-
raise ValueError('linelengths and positions are unequal sized \
3942-
sequences')
3941+
raise ValueError('linelengths and positions are unequal sized '
3942+
'sequences')
39433943
if len(linewidths) != len(positions):
3944-
raise ValueError('linewidths and positions are unequal sized \
3945-
sequences')
3944+
raise ValueError('linewidths and positions are unequal sized '
3945+
'sequences')
39463946
if len(colors) != len(positions):
3947-
raise ValueError('colors and positions are unequal sized \
3948-
sequences')
3947+
raise ValueError('colors and positions are unequal sized '
3948+
'sequences')
39493949
if len(linestyles) != len(positions):
3950-
raise ValueError('linestyles and positions are unequal sized \
3951-
sequences')
3950+
raise ValueError('linestyles and positions are unequal sized '
3951+
'sequences')
39523952

39533953
colls = []
39543954
for position, lineoffset, linelength, linewidth, color, linestyle in \

lib/matplotlib/collections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,8 +1143,8 @@ def __init__(self,
11431143
if len(positions) == 0:
11441144
segments = []
11451145
elif hasattr(positions, 'ndim') and positions.ndim > 1:
1146-
raise ValueError('if positions is an ndarry it cannot have \
1147-
dimensionality great than 1 ')
1146+
raise ValueError('if positions is an ndarry it cannot have '
1147+
'dimensionality great than 1 ')
11481148
elif (orientation is None or orientation.lower() == 'none' or
11491149
orientation.lower() == 'horizontal'):
11501150
positions.sort()

0 commit comments

Comments
 (0)