数据可视化

matplotlib.pyplot基本用法

2016-09-28  本文已影响4644人  wildsre

参考:
官网文档
3d标注
legend

import matplotlib
print(matplotlib.matplotlib_fname())
from pylab import *
zhfont = mpl.font_manager.FontProperties(fname='/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc')

window 下
https://my.oschina.net/u/1180306/blog/279818

单个图像

多幅图中多个图像

subplot(236): 图像总数为2行x3列,中的第6幅图


23x
import matplotlib.pyplot as plt
plt.figure(1) # the first figure,也可以为字符串
plt.subplot(211) # the first subplot in the first figure
plt.plot([1, 2, 3])
plt.subplot(212) # the second subplot in the first figure
plt.plot([4, 5, 6])
plt.figure(2) # a second figure
plt.plot([4, 5, 6]) # creates a subplot(111) by default
plt.figure(1) # figure 1 current; subplot(212) still current
plt.subplot(211) # make subplot(211) in figure1 current
plt.title('Easy as 1, 2, 3') # subplot 211 title
fig=plt.figure()
ax1=fig.add_subplot(311)
上一篇 下一篇

猜你喜欢

热点阅读