You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Polar plot error bars don't rotate with angle #441
In this example the errorbars do not align with the theta of bar. I posted this as a question at stackoverflow, and maybe the answer could be useful. Surely, this should not be default behavior though.
Example non-working code:
from numpy import *
from matplotlib import pyplot as py
r=zeros([16])
err=zeros([16])
for i in range(16):
r[i]=random.randint(400,600)
err[i]=random.randint(20,50)
theta=arange(0,2*pi,2*pi/16)
width = pi*2/16
fig = py.figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.75, 0.79], polar=True)
bars = ax.bar(theta+pi/16, r, width=width, bottom=0.0,yerr=err)
ax.set_ylim(0,700)
py.show()
As of mpl 1.2.1 the error bar itself does align with theta, but the error bar cap does not. The cap is implemented as a marker, so either we need a way to specify the rotation of markers, or the cap needs to be implemented as a LineCollection, or perhaps as a gappy line.
Just trying to understand the state of this issue: is this still open and scheduled for a future release? Could I submit a PR with a fix?
After playing for a bit with a fork of this repository using a fix I've been using for a year now, I'm pretty sure I can patch it and submit a PR. I just wanted to ask before spending too much time on it.
Thanks for the reply, @dstansby. I just did some tests including my patch on the source code (version 2.1.2), and it seems to fix this problem in my plots, and the OP's plot without changing their script. An example using polar coordinates would be good too, what do you think?
Also, I may have some minor questions, is gitter an appropriate channel for that?
Hi @efiring. Apologies for the delay, I had to relocate recently.
I actually have a local version that works and fixes the issues I had, and the issue originally reported. I like this idea of a "Work in Progress" kind of PR. I will post more info within a couple of days.
Reacted by Harshal Prakash Patankar (pharshalp) and Rory Angus
Hi @thmosqueiro, I was wondering if you had managed to find some time to do this?
I have just come across this issue and it would be helpful to get it resolved.
If you haven't got the time to invest, could you share your code and I can go through the process of getting updated?
@thmosqueiro If you and @RoryIAngus could come up with a PR that solves this problem cleanly, that would be much appreciated. I would love to be able to close this issue, which dates back to 2011.
@efiring my current employment is prohibitive regarding open source contributions. I however would not mind sharing what I have done until before I got hired, which is documented and could be finalized by someone else. I talked to @jaquejbrito and she's interested in taking over my code and take responsibility over this task. I can most definitely provide her with feedback IRL and in here. Also, I'm sure if @RoryIAngus wants to also contribute, she'd be glad to have someone else to work with.
So @efiring she says that she could get started as soon as tomorrow. Sounds good?
Activity
efiring commentedon Jul 21, 2013
As of mpl 1.2.1 the error bar itself does align with theta, but the error bar cap does not. The cap is implemented as a marker, so either we need a way to specify the rotation of markers, or the cap needs to be implemented as a LineCollection, or perhaps as a gappy line.
tacaswell commentedon Jan 17, 2014
This is still the state on master
crypdick commentedon Jul 9, 2015
It seems to me like this has been resolved? Attached is the plot that the figure produces.
QuLogic commentedon Jul 15, 2015
@isomerase I think it's only correct for you because you are using a style that hides the caps. The caps are still not rotated on master.
tacaswell commentedon Sep 24, 2017
Still a bug 😞 but less visible now that the default style has no caps.
thmosqueiro commentedon Mar 4, 2018
Just trying to understand the state of this issue: is this still open and scheduled for a future release? Could I submit a PR with a fix?
After playing for a bit with a fork of this repository using a fix I've been using for a year now, I'm pretty sure I can patch it and submit a PR. I just wanted to ask before spending too much time on it.
dstansby commentedon Mar 5, 2018
I'm pretty sure this is still open, so if you have a fix a PR would be very appreciated!
thmosqueiro commentedon Mar 5, 2018
Thanks for the reply, @dstansby. I just did some tests including my patch on the source code (version 2.1.2), and it seems to fix this problem in my plots, and the OP's plot without changing their script. An example using polar coordinates would be good too, what do you think?
Also, I may have some minor questions, is gitter an appropriate channel for that?
jklymak commentedon Mar 5, 2018
yes, gitter is great for dev chat, including minor dev questions.
efiring commentedon Jun 11, 2018
Progress, @thmosqueiro? It is OK to submit a PR that is "Work in Progress", if that can help move it along.
thmosqueiro commentedon Jun 11, 2018
Hi @efiring. Apologies for the delay, I had to relocate recently.
I actually have a local version that works and fixes the issues I had, and the issue originally reported. I like this idea of a "Work in Progress" kind of PR. I will post more info within a couple of days.
RoryIAngus commentedon Dec 17, 2018
Hi @thmosqueiro, I was wondering if you had managed to find some time to do this?
I have just come across this issue and it would be helpful to get it resolved.
If you haven't got the time to invest, could you share your code and I can go through the process of getting updated?
Many thanks
efiring commentedon May 23, 2019
@thmosqueiro If you and @RoryIAngus could come up with a PR that solves this problem cleanly, that would be much appreciated. I would love to be able to close this issue, which dates back to 2011.
thmosqueiro commentedon May 23, 2019
@efiring my current employment is prohibitive regarding open source contributions. I however would not mind sharing what I have done until before I got hired, which is documented and could be finalized by someone else. I talked to @jaquejbrito and she's interested in taking over my code and take responsibility over this task. I can most definitely provide her with feedback IRL and in here. Also, I'm sure if @RoryIAngus wants to also contribute, she'd be glad to have someone else to work with.
So @efiring she says that she could get started as soon as tomorrow. Sounds good?
efiring commentedon May 23, 2019
Thank you.
RoryIAngus commentedon May 23, 2019
jaquejbrito commentedon May 23, 2019
Hi.
I'll start checking the code. After we can start working on it.
Tks
RoryIAngus commentedon May 24, 2019
Some code to recreate the error showing the end cap issue and how it is not rotating but staying aligned to the horizontal plane.
jaquejbrito commentedon May 24, 2019
Thanks for the sample code. I’m taking a look at thiago’s code, and should be able to stage his current changes in a forked repository soon.
GentilsTo commentedon Nov 21, 2020
Hey, @jaquejbrito, any progress related?