Changing the background color of the axes planes of a matplotlib 3D plot

On the basis of the scatterplot example of matplotlib, how can I change the gray background color of the 3 axes grid planes? I would like to set it to white, keeping the grid lines with the default gray color. I found this question but I couldn't apply it to the example. Thanks.


Using the same example. You can set the pane color using the set_pane_color method as described here You can set the color using the RGBA tuple:

# ...
# Set the background color of the pane YZ
ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))

For a slightly different approach, see below:

# Get rid of colored axes planes
# First remove fill
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False

# Now set color to white (or whatever is "invisible")

# Bonus: To get rid of the grid as well:

See this blog post that I used as my source.

Need Your Help

Illegal remote method in java

java rmi runtime-error illegalargumentexception

It's the first time I use java Rmi*. I have a custom class which extends UnicastRemoteObject and implements an interface which extends remote. I think that I have implemented the methods of the int...