13

I'm using Matplotlib's Axes3D to create a scatter plot with custom colors like this:

from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt fig = plt.figure(1) ax = Axes3D(fig) ax.scatter(xval, yval, zval, c=cval, cmap=plt.cm.gray) 

This works fine, but matplotlib automatically adds some shading to make more distant points appear more transparent/in a lighter color than closer points. This makes it very hard to visually compare the colors of the individual points.

Is there some way to turn this off?

2 Answers 2

7

You need to add depthshade=False as an argument in the scatter function.

ax.scatter(xval, yval, zval, c=cval, cmap=plt.cm.gray, depthshade=False) 

Matplotlib 3D tutorial

Sign up to request clarification or add additional context in comments.

Comments

2

Just add alpha = 1 as argument in the scatter function.

ax.scatter(xval, yval, zval, c=cval, alpha = 1, cmap=plt.cm.gray)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.