1.图例legend基础语法及用法
legend语法参数如下: matplotlib.pyplot.legend(*args, **kwargs)
Keyword
Descr iption
loc
Location code string, or tuple (see below).图例所有figure位置
prop
the font property字体参数
fontsize
the font size (used only if prop is not specifie
本文实例讲述了Python使用matplotlib模块绘制图像并设置标题与坐标轴等信息。分享给大家供大家参考,具体如下:
进行图像绘制有时候需要设定坐标轴以及图像标题等信息,示例代码如下:
#-*- coding: utf-8 -*-
#!/usr/bin/python
import matplotlib.pyplot as plt
from numpy.random import randn
x = range(100)
y = randn(100)
fig = plt.figure()
a