[ENH]: use new style format strings for colorbar ticks · Issue #21378 · matplotlib/matplotlib · GitHub
Skip to content

[ENH]: use new style format strings for colorbar ticks #21378

Description

@TLouf

Problem

At the moment, the default format strings in colorbar are old style ones, as in their init there is:

which is a different convention from the one of a normal axis, which was introduced in #16715.

Proposed solution

As in update_ticks we pass the colorbar's formatter to the long axis,

the if statement above may be removed to keep the default logic only in Axis. Right now one can pass a callable directly (although that's not documented), and the default behaviour from #16715 is triggered. However, I guess making this change for format strings would imply a deprecation cycle, as it breaks current behaviour. Another option would be to check in Axis._set_formatter for what kind of string format we've been passed (unsure how, although there must be way).

Additional context and prior art

No response

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions