FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: 3D surface is not plotted for the contour3d_3 example in the gallery · Issue #23895 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: 3D surface is not plotted for the contour3d_3 example in the gallery #23895

Description

Bug summary

The 3D surface is not plotted for the contour3d_3 example in the gallery.

Code for reproduction

# Straight from the official gallery of matplotlib
# https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cm

ax = plt.figure().add_subplot(projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)

# Plot the 3D surface
ax.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()

Actual outcome

Expected outcome

With matplotlib 1.4.3 it used to look like this:

Additional information

Last known working version: matplotlib 1.4.3

It is also broken in matplotlib 2.2.5

Operating system

No response

Matplotlib Version

3.5.3

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

Activity

  1. oscargus commented on Sep 15, 2022

    Member

    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.

  2. baharev commented on Sep 15, 2022

    ContributorAuthor

    @oscargus Thank you for your prompt reply. Yes, indeed, it seems to solve the issue. Should I create a pull request?

  3. oscargus commented on Sep 15, 2022

    Member

    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

  4. baharev commented on Sep 15, 2022

    ContributorAuthor

    OK, thanks. I will try to look into that as well.

  5. oscargus commented on Sep 15, 2022

    Member

    Thanks! Something like

    :doc:filename
    

    should do it. Also, I checked some other docs and if could change "Projecting" into "Project" as the heading, it would follow the guidelines...

  6. baharev commented on Sep 18, 2022

    ContributorAuthor

    @oscargus Please review the pull request #23930. Thanks!

  7. tacaswell commented on Sep 18, 2022

    Member

    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 😱

  8. baharev commented on Sep 18, 2022

    ContributorAuthor
  9. tacaswell commented on Sep 18, 2022

    Member

    🤦🏻 Pasted the wrong link (too many tabs on a laptop), meant to paste https://matplotlib.org/2.0.0/examples/mplot3d/contourf3d_demo2.html

  10. added this to the v3.6.1 milestone on Sep 18, 2022
  11. added a commit that references this issue on Sep 20, 2022
    f44e70e
  12. added a commit that references this issue on Sep 20, 2022
    899983c
  13. added a commit that references this issue on Sep 21, 2022
    5bef1a2
  14. added a commit that references this issue on Dec 19, 2022
    09d0fa2
  15. added a commit that references this issue on Feb 25, 2023
    60fc18e
  16. added 3 commits that reference this issue on Apr 19, 2026
    024139a
    1662556
    c2d94ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL