Skip to content

[Bug]: Plot_Surface accuracy overflow #30744

@cczw123

Description

@cczw123

Bug summary

The plot_surface will give a really weird issue if the value if of high precision.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D  # noqa


Z = np.array([[0.1,0.100000001],[0.100000000001,0.100000000]])
ny, nx = Z.shape
x = np.arange(nx)
y = np.arange(ny)
X, Y = np.meshgrid(x, y)

print(Z.min(), Z.max())       
print(Z.shape, X.shape)       

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, Z)
plt.show()

Actual outcome

Image

Expected outcome

Image

Additional information

No response

Operating system

No response

Matplotlib Version

3.10.0

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions