-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate plot_date() #18154
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
Comments
I don't want to prefetch the dev call discussion to a lengthy thread here, so please don't comment unless you think it's absolutely crucial for preparation of the dev call. |
Did this get discussed/are there any notes on the discussion from the dev call? |
No, we did not come to this in the last call. |
Is there scope for discussion of this off the call? |
Do you mean you want to discuss this outside the call? If you have additional arguments, you can post them here. I just think reaching a decision is easiest when having a proposal and discussing that in the call. BTW: I can't make it to next Monday's call. Either discuss this without me (my opinion is laid out above), or shift one week. |
I am uncertain, however, about the So overall, I am mildly concerned about dropping |
Related to matplotlib/matplotlib#18154 - inconsistent default of fmt argument
This is a writeup / proposal to serve as a basis for discussion in the dev call on 03 Aug 2020.
plot_date()
is essentially a thin wrapper aroundplot()
but has different defaults forfmt
. This causes confusion #17548, #18141.Context
Use case:
plot_date()
dates back way before Matplotlib supported units. It's nowadays only necessary if you have plain numbers (in matplotlibs epoch).datetime
s are directly handled inplot()
via the unit system.While there may be users for
plot_date()
, i suppose it's rather a niche application.Naming: The name is a bit misleading in that it suggests that you should use the function if you want to plot dates. This implicitly includes
datetime
/date
which would be misleading. I'm suspecting that it may lead users withdatetime
/date
objects on the wrong track. (plot_as_date()
would have been more appropriate, but we're not gonna change that).API design:
plot_date()
is an ad-hoc aggregation ofplot()
andaxis_date()
Recommendation
Given the above context, I propose to deprecate
plot_date()
in favor ofax.plot()
andax.x/yaxis.axis_date()
.At the same time, deprecate
ax.x/yaxis_date()
in favor ofax.x/yaxis.axis_date()
. This reduces the API footprint ofAxes
. IMHO we don't need to have wrappersx/yfoo()
wrappers for everyfoo()
function on the axis. While common ones likeset_x/ylabel()
have a justification, it's fine in general to useax.xaxis.foo()
.Alternatives:
fmt
to matchplot()
- Such a default change requires as much user action as the deprecation, but we keep all the unnecessary redundancy / imperfect naming.plot_date()
code.The text was updated successfully, but these errors were encountered: