Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot_surface displays darkened colormap #2811

Closed
abnowack opened this issue Feb 14, 2014 · 1 comment
Closed

plot_surface displays darkened colormap #2811

abnowack opened this issue Feb 14, 2014 · 1 comment

Comments

@abnowack
Copy link

When using plot_surface and the mpl_toolkits for displaying surfaces in 3D space the displays colors are always darker than the colormap provides. This is very unintuitive and not expected.

Here is an example demonstrating the behavior:

import numpy as np
from matplotlib import pyplot
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D

X, Y = np.meshgrid(np.arange(-1, 1, 0.1), np.arange(-1, 1, 0.1))
Z = np.zeros_like(X)

F = np.sqrt(X**2 + Y**2)
F -= np.min(F)
F /= np.max(F)

fig = pyplot.figure()
ax = fig.gca(projection='3d')
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=cm.coolwarm(F))

The output shows,
example

The coolwarm colormap is obviously darkened with no option of disabling this behavior.

Not clear if this is intended behavior, but setting a colormap by hand should yield that colormap, not a tinted version of it.

@abnowack
Copy link
Author

I apologize, it appears the shade argument is what I was missing ... I wasn't aware the lighting in matplotlib was as sophisticated. Closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant