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
fix y-axis scaling when calm_limit
is provided
#243
Conversation
Nice! Glad to contribute. |
I am having more thoughts about what the correct scaling of the inner (calm) circle is.
But the fraction of calm conditions should be the area no? So could we achieve this by dividing by the number of sectors (16 in this case)?
Or alternatively, what if we set
So I am wondering what the mathematically correct way is, but also what the most readable option is, while being reasonably mathematically correct. Happy to also hear your thoughts on this @jparta, since you already had a deeper look into this calm issue. |
With small plot, such as in the case of plotting multiple plots on a map, reading percentage may not be viable. In that case, being able to read the approximate calm percentage off the r axis is helpful. The last option you presented (circle area) seems to work quite well. |
yeah, the annotations are not part of the implementation, I added them manually afterwards. I also don't think that it makes sense to always include them. Maybe it's worth documenting this. Reading the calm percentage from the r-axis/y-axis remains tricky, since the scale still starts at 0, since it's "% from direction x". So I think this is simply a shortcoming of the type of graph. But being able to visually approximate the percentage of calm conditions (or add the text annotation somewhere) is still nice and also comparable to the rest. I think going with the area approach will be a sufficient compromise. Thanks for having a look! |
Agreed. I think that an example in the docs would suffice.
LGTM. Thanks for guiding us through you thinking process. Made it a bit easier to review this PR :-) I'll try to clean up the conflicts here and merge it. |
This was promised in plotting methods: "...all data below this value will be removed from the computation." Previously, the legend would start with '[0.0' in the first label, even with calm_limit > 0. Now labels are accurate.
The actual parameter is called 'nesctor'.
set_rorigin bascially does what was done manually here without the coloring - added tests for this also including the previous legend fix patch by Joonatan Partanen
continues/supersedes #240
Previously there were issues with how the center calm circle was created and scaled with the y-axis.
matplotlib has the
set_rorigin
which also can be set to a negative value, shifting the 0 mark outwards.While calm conditions do not have a direction, they still count into the fraction of wind directions e.g. when having calm conditions for half of the time and northerly winds for the other half, there still aren't 100% northerly winds, but 50%!
In case someone want's to display only non calm conditions only, they can already mask their data beforehand.
The result looks like this, scaling the inner circle with the fraction/number of calm conditions. The inner circle and the outside bars always sum up to 100% or N.
Code for the plots