reference other engineer's code to explain wheather linux terminal can display matplotlib' figure
来源:互联网 发布:c 游戏编程 pdf 编辑:程序博客网 时间:2024/05/22 12:29
柱状图(plt.bar)
代码与注释
import numpy as npfrom matplotlib import pyplot as pltplt.figure(figsize=(9,6))n = 8X = np.arange(n)+1#X是1,2,3,4,5,6,7,8,柱的个数# numpy.random.uniform(low=0.0, high=1.0, size=None), normal#uniform均匀分布的随机数,normal是正态分布的随机数,0.5-1均匀分布的数,一共有n个Y1 = np.random.uniform(0.5,1.0,n)Y2 = np.random.uniform(0.5,1.0,n)plt.bar(X,Y1,width = 0.35,facecolor = 'lightskyblue',edgecolor = 'white')#width:柱的宽度plt.bar(X+0.35,Y2,width = 0.35,facecolor = 'yellowgreen',edgecolor = 'white')#水平柱状图plt.barh,属性中宽度width变成了高度height#打两组数据时用+#facecolor柱状图里填充的颜色#edgecolor是边框的颜色#想把一组数据打到下边,在数据前使用负号#plt.bar(X, -Y2, width=width, facecolor='#ff9999', edgecolor='white')#给图加textfor x,y in zip(X,Y1): plt.text(x+0.3, y+0.05, '%.2f' % y, ha='center', va= 'bottom')for x,y in zip(X,Y2): plt.text(x+0.6, y+0.05, '%.2f' % y, ha='center', va= 'bottom')plt.ylim(0,+1.25)plt.show()
0 0
- reference other engineer's code to explain wheather linux terminal can display matplotlib' figure
- Linux Terminal Command Reference
- class matplotlib.figure.Figure
- matplotlib--figure
- Custom tool error: Failed to generate code for the service reference ××××××. Please check other erro
- Some Linux Terminal Command Reference
- Responding to Other's Writing
- Test Engineer’s Guide to HDMI 1.4
- matplotlib的figure窗口
- matplotlib.pyplot.figure
- matplotlib.pyplot.figure
- The Scientist and Engineer's Guide to Digital Signal Processing
- The Scientist and Engineer's Guide to Digital Signal Processing
- Code::Blocks undefine reference to ‘XXX函数’
- code::blocks - undefined reference to `_WinMain@16'
- Code::Blocks : undefined reference to `xxxxxx@4'
- Intel promises to bring wireless display technology to other mobile devices
- linux异常系列:Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- 数据结构——Josephus问题顺序表实现
- leetCode练习(36)
- python合并同类型excel表格
- MySql的安装
- Android 硬件加速
- reference other engineer's code to explain wheather linux terminal can display matplotlib' figure
- LVS之——Lvs Net网络拓扑实现负载均衡
- SVM-Pegasos实现
- 《多处理器编程的艺术》学习笔记一:确保线程互斥、公平地并行,以及解决死锁问题的经典思想
- 互斥锁读取与顺序读取性能比较
- IO(二)
- 基于ubuntu 14搭建nginx+php+mysql环境
- 汇编语言二 debug程序
- Apache Mina 2.0.13 - Remote Command Execution