Former-commit-id:a02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]] Former-commit-id:06a8b51d6d
Former-commit-id:3360eb6c5f
17 lines
361 B
Python
Executable file
17 lines
361 B
Python
Executable file
from mpl_toolkits.mplot3d import Axes3D
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
|
|
fig = plt.figure()
|
|
ax = Axes3D(fig)
|
|
for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]):
|
|
xs = np.arange(20)
|
|
ys = np.random.rand(20)
|
|
ax.bar(xs, ys, zs=z, zdir='y', color=c, alpha=0.8)
|
|
|
|
ax.set_xlabel('X')
|
|
ax.set_ylabel('Y')
|
|
ax.set_zlabel('Z')
|
|
|
|
plt.show()
|
|
|