Nicer axes names in selector for figure options. #5667

Merged
merged 1 commit into from Dec 15, 2015

Conversation

Projects
None yet
3 participants
Contributor

anntzer commented Dec 13, 2015

Replace the old label, which included the legthy repr of the axes
object, to a nicer label which emphasizes the title or axes labels
(depending on what is present). Also drops the use of the label of the
Axes object itself, for which I haven't found any other reference or use
in general. (Another option would be to use solely Axes.get_label()
when defined, as this doesn't seem to have any other use.)

See #5468.

@tacaswell tacaswell and 1 other commented on an outdated diff Dec 13, 2015

lib/matplotlib/backends/backend_qt5.py
if title:
- fmt = "%(title)s"
- if ylabel:
- fmt += ": %(ylabel)s"
- fmt += " (%(axes_repr)s)"
- elif ylabel:
- fmt = "%(axes_repr)s (%(ylabel)s)"
- elif label:
- fmt = "%(axes_repr)s (%(label)s)"
+ name = title
+ elif xlabel and ylabel:
@tacaswell

tacaswell Dec 13, 2015

Owner

Maybe be a bit more forgiving on this and allow only one of them?

@anntzer

anntzer Dec 13, 2015

Contributor

Fixed.

@anntzer anntzer Nicer axes names in selector for figure options.
Replace the old label, which included the legthy repr of the axes
object, to a nicer label which emphasizes the title or axes labels
(depending on what is present).  Also drops the use of the label of the
Axes object itself, for which I haven't found any other reference or use
in general.  (Another option would be to use solely `Axes.get_label()`
when defined, as this doesn't seem to have any other use.)

See #5468.
d981e2b

@tacaswell tacaswell added a commit that referenced this pull request Dec 15, 2015

@tacaswell tacaswell Merge pull request #5667 from anntzer/friendlier-axes-selector
Nicer axes names in selector for figure options.
ef9bbe2

@tacaswell tacaswell merged commit ef9bbe2 into matplotlib:master Dec 15, 2015

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 68.272%
Details

tacaswell removed the needs_review label Dec 15, 2015

Owner

tacaswell commented Dec 15, 2015

👍 keep up the good work!

anntzer deleted the anntzer:friendlier-axes-selector branch Dec 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment