Matplotlib移动y轴刻度标签

时间:2016-03-13 03:50:58

标签: python matplotlib

给出这样的情节:

import matplotlib.pyplot as plt
plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

# Example data
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
y_pos = np.arange(len(people))
performance = 3 + 10 * np.random.rand(len(people))
error = np.random.rand(len(people))

plt.barh(y_pos, performance, xerr=error, align='center', alpha=0.4)
plt.yticks(y_pos, people)

plt.show()

如何只将y轴刻度(不是刻度标签)移动到指定的度数?

此外,我如何移动刻度标签?

提前致谢!

0 个答案:

没有答案