Skip to content

[ENH]: Plotting masked arrays correctly in 3D line plot #25043

@lars-nagel

Description

@lars-nagel

Problem

It would be great if the masking feature worked in 3D plots:

import matplotlib.pyplot as plt
import numpy as np

# Create some data
x = np.linspace(0, 10, 100)
y = np.linspace(0, 10, 100)
z = np.sin(x) * np.cos(y)

# Mask some of the data
mask = z > 0.5
z = np.ma.array(z, mask=mask)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot(x, y, z)
fig.show()

Currently, all of the data is plotted.

Proposed solution

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions