Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
DOC Clean up on about half the Mplot3d examples #6303
Conversation
mdboom
changed the title from
DOC Clean up on about half the Mplot3d examples to DOC Clean up on about half the Mplot3d examples
Apr 14, 2016
mdboom
added the
needs_review
label
Apr 14, 2016
tacaswell
added this to the
2.1 (next point release)
milestone
Apr 14, 2016
tacaswell
added Documentation mplot3d
labels
Apr 14, 2016
|
attn @WeatherGod |
|
The failures on Travis are legit, some pep8 (forgot to pylint the last couple files I worked on) and apparently my polys3d_demo.py throws an error on the Travis environment that isn't thrown on my computer. I'll sort these out tonight or tomorrow. |
|
The errors I mentioned are fixed now. By the way, I haven't changed any file names yet but as I understand it the '_demo' should be dropped from all names and files that are only differentiated by numbers should get more descriptive names. I don't have any good ideas for renaming the five contour examples, any suggestions? |
WeatherGod
and 1 other
commented on an outdated diff
Apr 15, 2016
| cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm) | ||
| cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm) | ||
| +cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm) |
WeatherGod
Member
|
WeatherGod
and 1 other
commented on an outdated diff
Apr 15, 2016
| @@ -1,7 +1,9 @@ | ||
| -""" | ||
| -.. versionadded:: 1.1.0 | ||
| - This demo depends on new features added to contourf3d. | ||
| -""" | ||
| +''' | ||
| +Demonstrates displaying a 3D surface while also projecting filled contour | ||
| +'profiles' onto the 'walls' of the graph. | ||
| + | ||
| +See contourf3d_demo2 for the unfilled version. |
|
|
WeatherGod
and 1 other
commented on an outdated diff
Apr 15, 2016
| X, Y = np.meshgrid(X, Y) | ||
| R = np.sqrt(X**2 + Y**2) | ||
| Z = np.sin(R) | ||
| surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, | ||
| linewidth=0, antialiased=False) | ||
| - | ||
| ax.set_zlim3d(-1, 1) |
WeatherGod
Member
|
WeatherGod
and 1 other
commented on an outdated diff
Apr 15, 2016
| from mpl_toolkits.mplot3d import Axes3D | ||
| from matplotlib.collections import PolyCollection | ||
| from matplotlib.colors import colorConverter | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| +def cc(arg): | ||
| + ''' | ||
| + Shorthand to convert 'named' colours to rgba format at 60% opacity. |
|
|
WeatherGod
commented on an outdated diff
Apr 15, 2016
| ax.set_zlabel('Z') | ||
| +ax.set_xlim3d(0, 10) | ||
| +ax.set_ylim3d(-1, 4) |
WeatherGod
Member
|
TrishGillett
added some commits
Apr 2, 2016
|
All discussed changes are incorporated, I amended them into their corresponding commits. |
WeatherGod
merged commit f00db67
into matplotlib:master
Apr 19, 2016
mdboom
removed the
needs_review
label
Apr 19, 2016
|
Thanks for your efforts. Cleanups are always welcomed! |
TrishGillett commentedApr 14, 2016
My goal is to make it easy to understand what the code is doing, so people flipping through examples can quickly judge if an example has something they can use, and so people borrowing a bit of code will understand how to modify it responsibly, so to speak.
There are guidelines on MEP12 and comments on issue #6221 about what examples should strive to do. I may not have ticked every single box mentioned in those places, but I've made the formatting a lot more consistent, added a lot of docstrings and comments, and made other mostly cosmetic changes. Let me know if there are any particular style points you'd like to see done differently.
I made one nontrivial change, to the behaviour of polys3d_demo. I changed it so that it forms the bottom facet of each polygon by creating two new vertices rather than overwriting two of the y data points. I thought it was better to assume that a user might want to do this using some data of theirs which shouldn't be overwritten.