Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Axes3d plot_surface not supporting masked arrays? #4941

Closed
Milestone
@maxnoe

Description

@maxnoe

Consider this code:

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors as colorsfrom matplotlib import cmfrom mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()ax = fig.add_subplot(1, 1, 1, projection='3d')x, y = np.meshgrid(np.linspace(-1, 1), np.linspace(-1, 1))z = x**2 + y**2z[10:20, 10:20] = 0.0masked_array = np.ma.masked_equal(z, 0.0)palette = cm.graypalette.set_over('g', 1.0)palette.set_under('b', 1.0)palette.set_bad('r', 1.0)ax.plot_surface(x,y,masked_array,    rstride=1,    cstride=1,    cmap=palette,    vmin=-1,    vmax=1,    )plt.show()

The area set to zero should be red, but it isn't. It works on a 2d axis using pcolormesh.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp