-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Sprint] Added a test for 3d plots in PDF backend #2163
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- This failed at one point (see issue #1933) - Seems to work now
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
from matplotlib import rcParams | ||
import numpy as np | ||
|
||
from matplotlib import cm, rcParams | ||
from matplotlib import pyplot as plt | ||
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup | ||
|
||
|
@@ -34,3 +36,14 @@ def test_type42(): | |
ax = fig.add_subplot(111) | ||
ax.plot([1,2,3]) | ||
fig.savefig(io.BytesIO()) | ||
|
||
def test_3d(): | ||
import io | ||
from mpl_toolkits.mplot3d import Axes3D | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be nice to import this at the top of the module. |
||
fig = plt.figure() | ||
ax = fig.add_subplot(1, 1, 1, projection='3d') | ||
ax.view_init(elev=None, azim= -15) | ||
X, Y = np.meshgrid(np.arange(3), np.arange(3)) | ||
Fs = X * Y | ||
ax.plot_surface(X, Y, Fs, cmap=cm.jet, lw=0, antialiased=False) | ||
plt.savefig(io.BytesIO()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So my preference would be to turn this into a visual test so that we can not only test that this is still working, but that the plot looks as it should. We have a visual test system to simplify this process but I don't believe there are yet any other mplot3d plots being tested. In that case this would be a landmark test so nice work! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, if mplot3d isn't being tested now we should do that! I'll make some tests and move this plot to there. Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #2135 which allows for starting to test the toolkits (at least the ones that ship with mpl) |
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.
@WeatherGod - do we have any other mplot3d tests? If so, are they proper image tests?