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
BUG fix: prevent 2D axis from showing up after calling Axes3D.cla() #4553
Conversation
Good catch. Could you add an image test using the example? |
👍 It is great when small changes fix big problems. |
@WeatherGod : I am unclear on what you mean by adding an "image test". where would this go? (I am new to matplotlib development) |
This should explain what I mean: http://matplotlib.org/devel/testing.html#writing-a-simple-test Tests for mplot3d are at lib/mpl_toolkits/tests/test_mplot3d.py |
You probably only need the png for this case. |
I do find it interesting that fixing this required a change in the base Axes class. Usually, all of mplot3d's bugs are contained entirely within mplot3d... |
Yes, I had originally started to change the cla() method in the Axes3D object, but then realized that just changing that single line in the base class would do it! I will add the test as suggested later today |
python2.6 test failure looks like it is one of those intermittent errors. I restarted it. |
BUG fix: prevent 2D axis from showing up after calling Axes3D.cla()
Thanks for the fix! I finally had a moment to look deeper into the problem, and it isn't so much that calling ax.cla() would generally result in a bad axes, but rather that Axes.cla() didn't reset all of the attributes needed because it was focused on explicitly resetting certain attributes (that only applied to 2d plots) rather than calling various functions that would have been extended in subclasses of Axes. If someone happened to change one of those attributes prior to calling ax.cla(), then that attribute wouldn't get reset. |
This fixes a bug in Axes3D where the call to .cla() erroneously results in a 2D axis being drawn.
To see the bug on current master, run the following code and note that a 2D rather than 3D axis is displayed
Here is a screenshot of the output of the above: