FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: `CbarAxesBase.toggle_label` doesn't seem to work properly · Issue #23595 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: CbarAxesBase.toggle_label doesn't seem to work properly #23595

Closed

Description

Bug summary

It appears as if CbarAxesBase.toggle_label and therefore, maybe, SimpleAxisArtist.toggle and possibly something else does not work as expected.

Probably related to the colorbar rewrite?

Code for reproduction

https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid.html

Actual outcome

The two middle figures have visible tick labels for the color bar.

Expected outcome

No visible tick labels.

Additional information

There seems to be some sort of mismatch between the _axisnum property and the location of the labels. It seems to work if the labels are located at the same side as the colorbar, i.e., right and bottom.

Operating system

Arch

Matplotlib Version

3.5.2 and main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

git checkout

Activity

  1. added
    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Aug 30, 2022
  2. oscargus commented on Aug 30, 2022

    MemberAuthor

    Marking as good first issue, but medium as it requires digging in how to modify the calls here (and possibly deprecating/replacing any other methods that may be affected).

    These are the lines that are not working properly:

    def toggle_label(self, b):
    axis = self.axis[self.orientation]
    axis.toggle(ticklabels=b, label=b)

  3. vorbrodt commented on Sep 1, 2022

    I would like to be assigned to this issue.

  4. oscargus commented on Sep 1, 2022

    MemberAuthor

    @vorbrodt Thanks for your interest! We do typically not assign persons to issues, but feel free to work on it anyway. Your note will most likely lead to people focusing on other issues instead,

  5. oscargus commented on Sep 1, 2022

    MemberAuthor

    Just noting that there are some other demos that also use toggle_label, where it appears as the output is not really as expected:

    https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid2.html
    https://matplotlib.org/stable/gallery/axes_grid1/demo_edge_colorbar.html

    Going back to 3.4.3, they probably are as expected:
    https://matplotlib.org/3.4.3/gallery/axes_grid1/demo_axes_grid2.html
    https://matplotlib.org/3.4.3/gallery/axes_grid1/demo_edge_colorbar.html
    https://matplotlib.org/3.4.3/gallery/axes_grid1/demo_axes_grid.html

    (Although demo_edge_colorbar.html seems to be missing a label on the left figure in all available versions of the documentation...)

  6. vorbrodt commented on Sep 5, 2022

    Okay, I see. I'll be working on this issue.

  7. oscargus commented on Oct 22, 2022

    MemberAuthor

    The problem seems related to self._axisnum having the wrong value so

    if _ticklabels is not None:
    tickparam = {f"label{self._axisnum}On": _ticklabels}
    self._axis.set_tick_params(**tickparam)

    is not correct.

  8. xtanion commented on Mar 9, 2023

    Contributor

    Hi @oscargus, I was trying to fix this issue...maybe self._axisnum isn't incorrect (As it is 1 for bottom and left axes & 2 for top & right). The issue seems to be related with the colorbar having two labels when it's set to top and left. I managed to solve it by disabling the bottom and right axes for both cases. Is it the expected outcome?

  9. anntzer commented on May 13, 2023

    Contributor

    Bisects to #20054.

  10. jklymak commented on May 13, 2023

    Member

    I don't quite understand how this can bisect to #20054? That PR is for the normal colorbar axes, not the CbarAxes?

  11. anntzer commented on May 13, 2023

    Contributor

    cbaraxes ultimately uses normal colorbars (it's just an axes subclass that adds a colorbar() method on the axes to draw colorbars on that axes).

  12. added this to the v3.8.0 milestone on May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuestopic: mpl_toolkit🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL