I cannot find the correct way to set cmap (or colors) for the 3d bar chart in matplotlib in my iPython laptop. I can correctly configure the chart (28 x 7 labels) in the X and Y plane with some random Z values. The graph is difficult to interpret, and one of the reasons is that the default colors for the x_data labels are [1,2,3,4, 5] are the same.
Here is the code:
%matplotlib inline
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as npfig = plt.figure(figsize=(18,12))
ax = fig.add_subplot(111, projection='3d')
x_data, y_data = np.meshgrid(np.arange(5),np.arange(3))
z_data = np.random.rand(3,5).flatten()
ax.bar3d(x_data.flatten(),
y_data.flatten(),np.zeros(len(z_data)),1,1,z_data,alpha=0.10)
The result is the following diagram:

I do not want to define colors manually for x_data shortcuts. How to set up different "random" cmap colors for each of the labels in x_data, while maintaining
ax.bar3d
parameter? Below is an option using
ax.bar
and different colors, but I need ax.bar3d .
