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

plot_trisurf: color and facecolor keyword #9535

Open
Labels
keepItems to be ignored by the “Stale” Github Actiontopic: mplot3d
@nlichtenberg

Description

@nlichtenberg

I guess this is not a bug, but I rather miss something, so I just formulate this as a question:
How can I set individual facecolors when plotting withplot_trisurf?

Here's a modified version ofthis example:

from mpl_toolkits.mplot3d import Axes3Dimport matplotlib.pyplot as pltimport numpy as npn_radii = 8n_angles = 36# Make radii and angles spaces (radius r=0 omitted to eliminate duplication).radii = np.linspace(0.125, 1.0, n_radii)angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)# Repeat all angles for each radius.angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)# Convert polar (radii, angles) coords to cartesian (x, y) coords.# (0, 0) is manually added at this stage,  so there will be no duplicate# points in the (x, y) plane.x = np.append(0, (radii*np.cos(angles)).flatten())y = np.append(0, (radii*np.sin(angles)).flatten())# Compute z to make the pringle surface.z = np.sin(-x*y)fig = plt.figure()ax = fig.gca(projection='3d')# my changes:c    = ((1, 0.0, 0.0),(0.0, 1.0, 0.0))ax.plot_trisurf(x, y, z, linewidth=0.2, antialiased=True, edgecolors=c, facecolors=c) modified this lineplt.show()

The edge colors are set as expected, but the face colors are unaffected and displayed with the default blue color.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actiontopic: mplot3d

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp