-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bug in Axes.relim when the first line is y_isdata=False and possible fix #854
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
This is still broken even with #731. Once that is in, I will take a closer look at this. |
There is a deeper problem here. Notice how the following code results in different results:
Essentially, the problem comes down to the fact that the I should add, I don't think your EDIT: Fixed attached code. |
@pelson I'm struggling to see the difference in those two pieces of code. |
Doh! I have edited it now. |
…on transform when doing spine.set_position(). Also includes a testcase for the data locations.
…2, which fixes a problem with alpha-blending partially transparent backgrounds.
Fixed background colour of PNGs saved with a non-zero opacity.
Rotated text element misalignment in Agg
…oblem Fixed failing bbox_inches='tight' case when a contour collection is empty
…ll be rendered as black. Also fixes test case result that hit this bug
Specifically, alters the base, AGG, PDF, PGF, SVG, Cairo, and Mac OS X backends to better enable the use of RGBA color values for both fills and edges. An explicit alpha attribute, if set, will override the alpha channels of the color values. Updates test results, which are now what would be expected. Also fixes a couple bugs with handling of linestyles.
…tiple images together.
Imsave now preserves the alpha channel.
Conflicts: .travis.yml lib/matplotlib/tests/baseline_images/test_png/pngsuite.png lib/matplotlib/tests/test_axes.py
Use a subdirectory of $XDG_CONFIG_HOME instead of ~/.matplotlibrc on Linux
Added the from_levels_and_colors function.
I think the problem is deeper than @pelson suggests. The problem here is that the "default" data range is (0, 1) on both axes. So when you start with a vline, it (correctly) ignores the y axis, and sets the xrange to (0.49, 0.51) and leaves the yrange as (0, 1). The subsequent auto limit operation on the line plot does not know that the previous y limits aren't meaningful, and therefore keeps them as they are (since they don't need to be expanded to show the data). I think the fix here is to update I've attached a patch against 1.2.x (since this bug exists there, too), but I'm not entirely sure it isn't too big/risky for 1.2. I'd like to get this in for 1.3, however. The attached PR also fixes #2061. |
Update homepage image
[DOC] Mathtext and matshow examples
Build the _windowing extension
changed URL to the current CSV API for yahoo finance
@@ -779,6 +779,16 @@ def unit(): | |||
""" | |||
return Bbox(Bbox._unit_values.copy()) | |||
|
|||
_null_values = np.array([[np.inf, np.inf], [-np.inf, -np.inf]], np.float_) |
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.
I can't see much point in defining this outside of the null staticmethod. Is there a performance reason?
Is there a reason for np.float_
rather than np.float
or the more explicit np.float64
?
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.
Probably not -- just being symmetrical with unit
.
I don't think this can go into v1.2.x, the change is functional (admittedly it was unintentional behaviour in the first place). The log scale test result is very different - its hard to know which one is expected, but it is without a doubt different behaviour. Would you mind providing your analysis on the test and why it was wrong? Other than that, this is a nice solution - though I have to admit I'm not too fussed whether it makes it into the Nice work @mdboom! |
…est_fix Fixed failing test on python3.
The log scale test adds a Yeah -- I think I agree about not including this in 1.2.x. I'll rebase and create a new PR for 1.3.x, also incorporating your other comments. |
Great. And thanks for the explanation - I'm more comfortable with the change now. The only remaining work is to add an API change entry for the change. Cheers, |
…er than the unit bounding box.
Closing in favor of #2082. |
You can reproduce the bug with:
Printed ylim is
-0.2 1.0
where the upper bound should be something like 0.25. You will see that there is big space between data line and the top bound.To workaround this problem, I defined the following functions:
If you call
relim(ax)
instead ofax.relim()
, printed ylim is-0.1 0.25
. I just simply separate the update of the line limits for x and y axis. I think you can simply replace the two functions with Axes.relim and Ax._update_line_limits.I have currently have no time for preparing executable development version of matplotlib and its test environment. I will send a pull request at some point when I am ready, but if somebody can "pull" the snippet above and test it, please do that.