Skip to content

[ENH]: Surface plot does not support interpolation #29878

Open
@XrioBtw

Description

@XrioBtw

Problem

I would like to see support for interpolation in plot_surface when facecolors is provided, similar to how interpolation works for imshow.

Code for intended solution:

import numpy as np
import matplotlib.pyplot as plt

X = np.array([[0,1,2],[0,1,2],[0,1,2]])
Y = np.array([[2,2,2],[1,1,1],[0,0,0]])
Z = np.array([[4,3,2],[3,2,1],[2,1,0]])
C = np.array([[(1,0,0),(1,1,0),(1,0.5,0)],[(0,0,1),(0,1,1),(0,1,0.5)],[(0,0,1),(1,0,1),(0.5,0,1)]])

fig, ax = plt.subplots(subplot_kw = {"projection": "3d"})
ax.plot_surface(X, Y, Z, shade = False, facecolors = C, interpolation = "bicubic")
plt.show()

Actual outcome:
AttributeError: Poly3DCollection.set() got an unexpected keyword argument 'interpolation'

Proposed solution

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions