Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

axes.format_{x,y} data should have a setter #17286

Open
@story645

Description

@story645

In theDate tick labels example, the code for setting the cursor coords message overwrites the default formatters:

ax.format_xdata=mdates.DateFormatter('%Y-%m-%d')ax.format_ydata=lambdax:'$%1.2f'%x# format the price.

This creates confusion because runs counter to how basically everything else in matplotlib is set via setter but especially the formatters:

ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))

andthe docs aren't especially clear either on this being a property:

Axes.format_xdata(self, x)    Return x formatted as an x-value.    This function will use the fmt_xdata attribute if it is not None, else will fall back on the xaxis major formatter.

To be consistent with the API, I'm proposing properties/functions of the form:

  • ax.{x,y}data_formatter(mdates.DateFormatter('%Y-%m-%d'))
  • ax.data_formatter(which=(x,y, both), mdates.DateFormatter('%Y-%m-%d'))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp