# Straight from the official gallery of matplotlib# https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.htmlfrommpl_toolkits.mplot3dimportaxes3dimportmatplotlib.pyplotaspltfrommatplotlibimportcmax=plt.figure().add_subplot(projection='3d')
X, Y, Z=axes3d.get_test_data(0.05)
# Plot the 3D surfaceax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
# Plot projections of the contours for each dimension. By choosing offsets# that match the appropriate axes limits, the projected contours will sit on# the 'walls' of the graph.ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100),
xlabel='X', ylabel='Y', zlabel='Z')
plt.show()
The would be much appreciated! I also noted a similar problem in https://matplotlib.org/devdocs/gallery/mplot3d/contourf3d_2.html plus that there are links between those files that a) don't work and b) are incorrectly named. "See contour3d_demo2 for the unfilled version." etc
Activity
oscargus commented on Sep 15, 2022
It seems like the default edgecolor has changed over time.
Adding edgecolor='black' to the plot_surface-call will reproduce the earlier image (sort of).
Not sure if there is anything else to do except adding that? It seems to make sense to add as the surface is not really clear in the current plot.
baharev commented on Sep 15, 2022
@oscargus Thank you for your prompt reply. Yes, indeed, it seems to solve the issue. Should I create a pull request?
oscargus commented on Sep 15, 2022
The would be much appreciated! I also noted a similar problem in https://matplotlib.org/devdocs/gallery/mplot3d/contourf3d_2.html plus that there are links between those files that a) don't work and b) are incorrectly named. "See contour3d_demo2 for the unfilled version." etc
baharev commented on Sep 15, 2022
OK, thanks. I will try to look into that as well.
oscargus commented on Sep 15, 2022
Thanks! Something like
should do it. Also, I checked some other docs and if could change "Projecting" into "Project" as the heading, it would follow the guidelines...
baharev commented on Sep 18, 2022
@oscargus Please review the pull request #23930. Thanks!
tacaswell commented on Sep 18, 2022
https://matplotlib.org/1.5.3/examples/mplot3d/contourf3d_demo2.html also looks right but https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_position.html is broken so this looks like it is (one hopes) a final fallout of the mpl 1 -> 2 style changes 😱
baharev commented on Sep 18, 2022
@tacaswell Please explain the "but https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_position.html is broken" part. What did I miss?
tacaswell commented on Sep 18, 2022
🤦🏻 Pasted the wrong link (too many tabs on a laptop), meant to paste https://matplotlib.org/2.0.0/examples/mplot3d/contourf3d_demo2.html
Merge pull request #23930 from baharev/main
Backport PR matplotlib#23930: Fix edge color, links, wording; closes m…
Merge pull request #23966 from meeseeksmachine/auto-backport-of-pr-23…
Fix edge color, links, wording; closes matplotlib#23895
pypi-matplotlib: Autospec creation for update from version 3.6.3 to v…
Fix edge color, links, wording; closes matplotlib#23895
Fix edge color, links, wording; closes matplotlib#23895
Fix edge color, links, wording; closes matplotlib#23895