Skip to content

outline attribute of colorbar not documented #19946

Closed

Description

@story645

Was trying to change the color of the outline of my colorbar:
image

and wasn't clear in the docs how to do it, but found on stackoverflow that there's an outline attribute that is the collection of spines:

 self.outline = ax.spines['outline'] = _ColorbarSpine(ax)

around the colorbar (and is not the same spines as the axes containing the colorbar since I tried that and it didn't work.)

Activity

  1. jklymak commented on Apr 12, 2021

    @jklymak
    Member

    Note #18900 will likely change this behaviour to be exactly the same as any other axes...

  2. QuLogic commented on Apr 13, 2021

    @QuLogic
    Member

    With the new Axes.spines shortcut, you can use ax.spines[:].set_color('red') on any Axes without worrying about the names.

  3. anushkrishnav commented on Apr 20, 2021

    @anushkrishnav
    Contributor

    I would like to work on this issue

  4. timhoffm commented on Apr 20, 2021

    @timhoffm
    Member

    AFAICS there is no clear action:

    • we don't want to start advertizing a special ax.spines['outline'] for colorbars if that will change to standard behavior in Enh better colorbar axes #18900.
    • ax.spines[:] works on any axis. It's documented on Spines and it doesn't make sense to add documentation on a general feature specifically to colorbars.

    @story645 do you see any specific documentation that we should add that would have helped you? Otherwise I propose to close this.

    @anushkrishnav Sorry that the action status is not clear/up-to-date.

  5. story645 commented on Apr 20, 2021

    @story645
    MemberAuthor

    Haven't closed it because I think it could be useful as a backport only doc (since ax.spines doesn't work on earlier versions) but I don't know quite how far back it'd be backported

  6. jklymak commented on Apr 20, 2021

    @jklymak
    Member

    I don't think we rebuild old docs...

  7. timhoffm commented on Apr 20, 2021

    @timhoffm
    Member

    ax.spines[:] is new in 3.4. https://matplotlib.org/stable/api/spines_api.html?highlight=spines#matplotlib.spines.Spines

    We don't update docs for previous releases. So I'm closing this as nothing to do.

    @story645 Maybe you want to twitter about this some day? This is not as glorious as subplot_mosaic, but a nice API to share.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions