I would like to change the transparency of the grid in matplotlib 3d plot.
But I find that it is not as easy as in 2d, which is simply plt.grid(alpha=0.2).
Here I give a mini code
import numpy as np
import matplotlib.pyplot as plt
data = np.random.randn(3, 100)
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
ax.scatter(data[0], data[1], data[2])
# How to change the grid transparency?
plt.show()
How to set the transparency of the x,y,z-grids?
I have tried:
Using
ax.zaxis._axinfo['grid'].update({"alpha": 0.1}). But it appears that it does not have the keyalpha.I checked the source code of
ax.grid()here in github. From the comments, it seems that thealphafunctionality is not implemented for 3d case at all.

