Skip to content

ENH: AxisInfo needs data readout formatter, e.g. for dates. #7819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
efiring opened this issue Jan 13, 2017 · 7 comments
Closed

ENH: AxisInfo needs data readout formatter, e.g. for dates. #7819

efiring opened this issue Jan 13, 2017 · 7 comments

Comments

@efiring
Copy link
Member

efiring commented Jan 13, 2017

The AutoDateFormatter handles the tick labels in a sensible way, but by default it is used for the data readout (e.g., Axes.fmt_xdata). As a result the data readout is highly discretized rather than quasi-continuous. This should handled automatically by dates.DateConverter specifying a suitable alternative formatter for the readout in the AxesInfo object it provides. This requires expanding AxesInfo and everything working with to support this additional (optional) information.

In the case of datetimes, one approach for the readout would be to use floating point instead of integer for the least-significant element of the tick format string. For example, if the ticks are formatted as integer year-month-days, the readout could be the same but with floating point days, perhaps 2 digits after the decimal.

@efiring efiring added this to the 2.2 (next next feature release) milestone Jan 13, 2017
@story645
Copy link
Member

I'm a bit confused as to how this isn't already handled in axesinfo since axesinfo takes both a major and minor formatter and that information is specified in dates.py...

@efiring
Copy link
Member Author

efiring commented Jan 16, 2017

The data readout, by default, comes from the formatter format_data_short, which calls format_data, which calls __call__. The solution for dates is probably to override the format_data_short method.

@story645
Copy link
Member

I think I'm a step behind. What is the data readout and how does it differ from the ticklabeling?

@efiring
Copy link
Member Author

efiring commented Jan 16, 2017

There might be a better name, but what I am calling the data readout is the cursor position output in the status line, showing x and y values of the cursor location in data coordinates.

@story645
Copy link
Member

Thanks, much clearer now, and something I'm 👍 on.

@jklymak
Copy link
Member

jklymak commented Mar 24, 2018

#10841 makes this just be the full datestring. Its not like the readout is short of space...

@anntzer
Copy link
Contributor

anntzer commented Dec 7, 2020

AFAICT this has indeed been fixed by #10841. Whether to make ConciseDateFormatter the default formatter is another question...

@anntzer anntzer closed this as completed Dec 7, 2020
@story645 story645 removed this from the future releases milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants