Matplotlib:如何给标签命名线图?

时间:2019-06-08 09:58:00

标签: python matplotlib data-visualization seaborn

我正在尝试使用matplotlib库绘制一些数据,我的绘制代码是:

from matplotlib import cycler
from matplotlib.pyplot import figure
import matplotlib.pyplot as plt

figure(num=None, figsize=(5, 6), dpi=100)
import numpy as np
colors = cycler('color',
               [
    '#d62728','#1f77b4'])
plt.rc('axes', facecolor='#E6E6E6', edgecolor='none',
      axisbelow=True, grid=True, prop_cycle=colors)
plt.rc('grid', color='w', linestyle='solid')
plt.rc('xtick', direction='out', color='gray')
plt.rc('ytick', direction='out', color='gray')
plt.rc('patch', edgecolor='#E6E6E6')
plt.rc('lines', linewidth=1.8)

plt.plot(micro_ac1[:130])
plt.plot(micro_ac2[:130])

plt.savefig('myfi.png', dpi=200)

情节看起来像这样:

enter image description here

我想给线条起个名字,并且线条和图形之间应该没有任何间隙。

enter image description here

我正在寻找这样的东西:

enter image description here

我想给线条命名,就像在该图中所看到的那样(以标签作为步骤)

0 个答案:

没有答案