1
我想繪製每個基地在x,y座標和高度等於z值的酒吧。下面的代碼似乎沒有正確捕獲我的X軸,我不知道爲什麼。matplotlib 3dbars:與軸的故障
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = [0.0245, 0.015, 0.0245, 0.0285, 0.0245, 0.0245]
y = [0.0024, 0.0075, 0.0095, 0.01, 0.008, 0.0018]
z = [11.71, 2.09, 2.49, 2.05, 2.72, 22.55]
ax.bar(x, y, z, zdir='z', color='g', alpha=.8)
plt.show()