Я строю точки на графике.Есть три строки.Я хочу дать ярлык для каждой строки.Я делаю так, как указано ниже:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
x_axis = np.array([1, 3, 5, 7, 9])
y_axis1 = np.array([173.825, 139.386, 129.364, 123.281, 119.162])
e1 = np.array([1.895, 1.599, 1.551, 1.783, 1.272])
y_axis2 = np.array([161.168, 143.071, 135.891, 131.081, 126.970])
e2 = np.array([2.076, 1.700, 1.400, 1.295, 0.788])
y_axis3 = np.array([208.306, 198.804, 193.063, 189.554, 185.764])
e3 = np.array([1.314, 1.350, 1.046, 1.770, 1.135])
plt.axis([0, 11, 110, 210])
plt.errorbar(x_axis, y_axis1, e1, linestyle='solid', marker='.', ecolor='red', color='blue', label='Line1')
plt.errorbar(x_axis, y_axis2, e2, linestyle='solid', marker='.', ecolor='red', color='green', label='Line2')
plt.errorbar(x_axis, y_axis3, e3, linestyle='solid', marker='.', ecolor='red', color='yellow', label='Line3')
plt.xlabel('Data')
plt.ylabel('Average')
plt.show()
Но ярлык не отображается.Вот вывод:
