我是靠谱客的博主 谦让自行车,这篇文章主要介绍Matplotlib绘制三维柱状图,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.axes3d import Axes3D # 3D引擎 month = np.arange(1,5) # 每个⽉ 4周 每周都会产⽣数据 # 三个维度:⽉、周、销量 fig = plt.figure(figsize=(9,6)) ax3 = Axes3D(fig) for m in month: ax3.bar(np.arange(4), np.random.randint(1,10,size = 4), zs = m , zdir = 'x',# 在哪个⽅向上,⼀排排排列 alpha = 0.7,# alpha 透明度 width = 0.5) ax3.set_xlabel('X',fontsize = 18,color = 'red') ax3.set_ylabel('Y',fontsize = 18,color = 'red') ax3.set_zlabel('Z',fontsize = 18,color = 'green')

image-20210106170441179

最后

以上就是谦让自行车最近收集整理的关于Matplotlib绘制三维柱状图的全部内容,更多相关Matplotlib绘制三维柱状图内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部