-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
bar plot: in 2.0.0 bars not as given in the description, ie. first arg is not "left" but "center" #7954
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
My hunch is that this a documentation/naming convention oversight in the wake of the changes to the defaults. IIRC, it was a bad user experience to align in the bars along the left edge (the previous default). So at some point, we added the Then with v2 we changed the default value of I'm not sure what the best path forward is. |
This is definitely intended behavior. The docstring on Unfortunately we can not re-name the first positional argument without breaking API, I think that is a wart we are stuck with. |
I agree that left align was a poor user experience and I welcome the change to center being the default. I was just surprised to see the change in one of my scripts after updating to 2.0.0, in particular since the description did not reflect the obtained behavior. I would suggest, though, to also make the same change to |
Oh, never mind, you need to use arithmetic mean with |
I also got hit by the doctring inconsistency (not by the change of default value, because I rarely use @tacaswell is it really impossible to rename the first argument from |
also as a different, but related, issue on the documentation of |
The v2.0 change was not an API change release. It was a style change
release. All code as written before still works now. What *might* be
possible is to change that argument name, and then add support for a "left"
kwarg by checking **kwargs for that key. If it is there, we can emit a
deprecation message, and then assign its value over to the new renamed
argument. Presumedly, this situation can only happen if supplying all the
arguments via **kwargs. The only hiccup with this idea is that the new
positional arguments wouldn't be filled by this approach, so the function
call would fail...
perhaps my idea could inspire someone else for a path for deprecating these
badly named arguments?
…On Sat, Apr 8, 2017 at 3:56 AM, Pierre Haessig ***@***.***> wrote:
also as a different, but related, issue on the documentation of bar
function: there is a data keyword argument in the signature which, I
believe, is not documented.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7954 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-NBDh7Hjp5qOqD4tMUVJWTGI7mwqks5rtz3AgaJpZM4Luski>
.
|
Isn't the API already broken if the meaning of a positional argument was changed? |
No, the meaning didn't change in v2.0, the default value for `align`
changed. The meaning changed when the `align` feature was added. The
documentation was always wrong since then, and it became more apparent when
the defaults changed in v2.0.
…On Mon, Jul 17, 2017 at 4:55 PM, Åsmund Steen Skjæveland < ***@***.***> wrote:
@tacaswell <https://github.com/tacaswell>
Unfortunately we can not re-name the first positional argument without
breaking API, I think that is a wart we are stuck with.
Isn't the API already broken if the meaning of a positional argument was
changed?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7954 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-H_fuRfJMf6SzjCrrgfIGdwtZv2Hks5sO8ovgaJpZM4Luski>
.
|
it is 'broken' in the sense that it is confusing not 'broken' in the sense that code will raise exceptions. |
Still advertising #7966 as a way to fix the signature... |
The consensus on the phone call today is:
|
Actually, upon further thought, we don't need to create signature objects; we can just do something like #6404 (comment). The advantage of using signature objects when using the #7966 decorator approach is that we can simulate positional-only args or even on Py2 keyword-only args, but if we're not using the decorator approach we may as well let the interpreter do the argument binding for us. So something like
|
Change the documented first position argument to x and y for bar and barh respectively but still support passing in left and bottom as keyword arguments. closes matplotlib#7954 closes matplotlib#8327 closes matplotlib#8527 closes matplotlib#8882
Change the documented first position argument to x and y for bar and barh respectively but still support passing in left and bottom as keyword arguments. closes matplotlib#7954 closes matplotlib#8327 closes matplotlib#8527 closes matplotlib#8882
Change the documented first position argument to x and y for bar and barh respectively but still support passing in left and bottom as keyword arguments. closes matplotlib#7954 closes matplotlib#8327 closes matplotlib#8527 closes matplotlib#8882
Change the documented first position argument to x and y for bar and barh respectively but still support passing in left and bottom as keyword arguments. closes matplotlib#7954 closes matplotlib#8327 closes matplotlib#8527 closes matplotlib#8882
Bug report
Bug summary
Using
bar
, the first input argument is not used for the left edge of the bar, but rather the center, as if the kwargalign='center'
was used. However, the desired behavior is obtained in both cases when usingalign = 'center'
andalign = 'edge'
. Just whenalign
is not specified, it should be 'edge' aligned which it is not.Code for reproduction
Actual outcome


Expected outcome
In matplotlib 1.5.3 I got the expected behavior.
Matplotlib version
matplotlib 2.0.0
python 3.6.0
both installed from the Arch Linux repository.
The text was updated successfully, but these errors were encountered: