10000 Merge pull request #9468 from tacaswell/fix_lpy_transforms_ne · matplotlib/matplotlib@b03c7d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b03c7d2

Browse files
authored
Merge pull request #9468 from tacaswell/fix_lpy_transforms_ne
FIX: provide __ne__ implementation for transforms in py2
2 parents 6638c09 + b5bc6aa commit b03c7d2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,3 +5353,19 @@ def test_patch_deprecations():
53535353
assert fig.patch == fig.figurePatch
53545354

53555355
assert len(w) == 2
5356+
5357+
5358+
def test_polar_gridlines():
5359+
fig = plt.figure()
5360+
ax = fig.add_subplot(111, polar=True)
5361+
5362+
# make all major grid lines lighter, only x grid lines set in 2.1.0
5363+
ax.grid(alpha=0.2)
5364+
5365+
# hide y tick labels, no effect in 2.1.0
5366+
plt.setp(ax.yaxis.get_ticklabels(), visible=False)
5367+
5368+
fig.canvas.draw()
5369+
5370+
assert ax.xaxis.majorTicks[0].gridline.get_alpha() == .2
5371+
assert ax.yaxis.majorTicks[0].gridline.get_alpha() == .2

lib/matplotlib/transforms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,10 @@ def __radd__(self, other):
12871287
# override `__eq__`), but some subclasses, such as TransformWrapper &
12881288
# AffineBase, override this behavior.
12891289

1290+
if six.PY2:
1291+
def __ne__(self, other):
1292+
return not (self == other)
1293+
12901294
def _iter_break_from_left_to_right(self):
12911295
"""
12921296
Returns an iterator breaking down this transform stack from left to

0 commit comments

Comments
 (0)
0