8000 Apply suggestions from code review · matplotlib/matplotlib@d710ab2 · GitHub
[go: up one dir, main page]

Skip to content

Commit d710ab2

Browse files
oscargustimhoffm
andauthored
Apply suggestions from code review
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 99b1152 commit d710ab2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,8 @@ def __repr__(self):
710710
for k in ["left", "center", "right"]:
711711
if hasattr(self, 'get_title'):
712712
title = self.get_title(loc=k)
713-
else:
714-
title = ""
715-
if title:
716-
titles.append(f"{k!r}:{title!r}")
713+
if title:
714+
titles.append(f"{k!r}:{title!r}")
717715
if titles:
718716
fields += ["title={" + ",".join(titles) + "}"]
719717
if self.get_xlabel():

lib/matplotlib/tests/test_axes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,18 +490,18 @@ def test_autoscale_tight():
490490
assert_allclose(ax.get_ylim(), (1.0, 4.0))
491491

492492
# Check that autoscale is on
493-
assert ax.get_autoscalex_on() is True
494-
assert ax.get_autoscaley_on() is True
495-
assert ax.get_autoscale_on() is True
493+
assert ax.get_autoscalex_on()
494+
assert ax.get_autoscaley_on()
495+
assert ax.get_autoscale_on()
496496
# Set enable to None
497497
ax.autoscale(enable=None)
498498
# Same limits
499499
assert_allclose(ax.get_xlim(), (-0.15, 3.15))
500500
assert_allclose(ax.get_ylim(), (1.0, 4.0))
501501
# autoscale still on
502-
assert ax.get_autoscalex_on() is True
503-
assert ax.get_autoscaley_on() is True
504-
assert ax.get_autoscale_on() is True
502+
assert ax.get_autoscalex_on()
503+
assert ax.get_autoscaley_on()
504+
assert ax.get_autoscale_on()
505505

506506

507507
@mpl.style.context('default')

0 commit comments

Comments
 (0)
0