-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed issues with errorbar limits #2452
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
Conversation
@efiring, @WeatherGod: git blame tells me you guys are reasonably well versed with the errorbar code. Any comments? |
plot_kw['markeredgewidth'] = capthick | ||
# For backwards-compat, allow explicit setting of | ||
# 'mew' or 'markeredgewidth' to over-ride capthick. | ||
if 'markeredgewidth' in kwargs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it, you might as well condense this sequence down to:
for key in ('markeredgewidth', 'mew', 'transform', 'alpha', 'zorder'):
if key in kwargs:
plot_kw[key] = kwargs[key]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea.
due to a bunch of things that have fallen onto my plate the past few days, |
@larrybradley Could you possibly add a test to this? |
@larrybradley This needs a re-base. Any progress on the reference? |
@tacaswell Is common sense not enough? :) For example, an upper limit is a maximum possible value (e.g. http://dictionary.reference.com/browse/upper+limit), meaning the possible data values are below the upper limit value. This is naturally plotted as a downward-facing arrow starting at the upper limit value. I tracked down when the upper/lower limits code was first added to matplotlib in Sep 2007, and it appears to have simply been implemented wrong. This is a correct statement, but unfortunately it was implemented such that the arrow directions were reversed. Does commonly-used ~22-year old IDL astronomy software count as a reference? |
I do not work with these types of graphs and I have found that 'common sense' is very subjective (see the difference of meaning in red/green in stock quotes between the west and the east). I would like @WeatherGod to OK this before merging. Travis is still failing, but is not letting me see the logs.... |
@@ -0,0 +1,53 @@ | |||
""" | |||
Demo of the errorbar function, includig upper and lower limits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling error here
I am a bit confused. I thought that this patch was going to make the arrows point inward. The example image shows them pointing outward, which I think is current behavior? Just wanted to make sure that that was what was intended. |
Thanks, @WeatherGod! I've fixed the typo and added the comments. The example image shows examples of both lower and upper limits in both x and y. |
@tacaswell Travis failed because of an extra space (pep8 check). It's fixed now. |
@larrybradley I realize what the example image is, I am just saying that the arrows in the example do not match what is described in the description of this PR:
From this description, I would have expected the arrows to now point inward, rather than outward, which is what I see in the example PNG image. Am I misinterpreting something? |
from
It looks correct to me. The green arrows are upper limits ( |
@WeatherGod I am leaving this PR to you, please merge when you are happy. |
let's dispose of the "up" and "down" words here, as it is easy to get On Tue, Feb 25, 2014 at 2:39 PM, Larry Bradley [email protected]:
|
I think the arrows are supposed to remain pointing "outward" -- it's merely that they were pointing in the wrong direction. i.e. an upper limit should have the arrow pointing down. I think this is definitely a bugfix, but it's enough of a change in behavior, that it definitely deserves an entry in whats_new and maybe api_changes as well. |
"i.e. an upper limit should have the arrow pointing down" do you mean outward or inward? The up and down notation is useless when I am perfectly willing to accept that my interpretation of this entire |
I'm sorry for any confusion. The arrow should always point outward, i.e. away from the data value. I think perhaps you are overthinking this. Conceptually, limits are very simple. In the plot below, I show the current matplotlib implementation vs. this PR. Hopefully this helps, because I don't know how to make it any simpler. |
Please don't merge this yet, as there is a pre-existing bug in |
Ok, now I see what you mean. Before this example, I thought "arrow" This is definitely a major change in behavior, though. I am hesistent to |
Based on the comparison and explanation provided by @larrybradley, I think the current mpl behavior makes no sense at all, so I don't think there should be a way to switch back to it. All this needs is documentation, as @mdboom noted above |
If I understand all this correctly, wouldn't similar results have been |
@WeatherGod, Yes, people could have switched it. So what? Maybe no one actually used it at all... Who knows? |
@WeatherGod and @efiring What do you two want to do about this PR? |
@larrybradley I think this should be merged ASAP, but this requires your PR to fix the pre-existing bug that you mention above, and it also needs entries in whats_new and api_changes, as @mdboom noted above. Will you be able to attend to these things? |
@efiring Sure, I'll try to finish the PR this week. I've been busy with other things. |
This should be ready to merge now. |
@larrybradley Can you rebase this? I suspect there are conflicts in the documentation files. |
@tacaswell OK, rebased now. |
@efiring Can you do the honors on this one? |
@larrybradley It looks like manual action was needed in the rebase, and a marker is still there.
|
@efiring I removed the errant marker and rebased again. |
Something has gone horribly wrong, there are now many pep8 failures.... |
It appears that most are related to comment symbols without spaces immediately afterward, i.e. |
However, master is currently building cleanly so the issues are arising from this merge. Does it pass pep8 locally for you? |
Odd, the pass locally for me, I tried re-starting the travis build. |
@larrybradley This needs to be rebased again. I suspect the issue is in CHANGELOG/whats_new |
@tacaswell OK, it's rebased again. |
Fixed issues with errorbar limits
merged before this required (yet) another re-base. |
This fixes two issues with errorbar limits. An upper limit means the exact value of a data point is unknown, but it is known not to be higher than a particular value. This is denoted by an downward arrow whose base is at the value of the limit. Similarly lower limits are upward arrows. This patch corrects the arrow directions (now flipped) and makes the arrow base at the data point (the arrow is no longer straddling the data limit). I've also included a new example file.
I think it would also be nice to add keywords to control the arrow size, face color, etc., but that is not implemented here.