【发布时间】:2020-05-19 09:19:05
【问题描述】:
我知道这听起来很简单,但谷歌仍然无法帮助我完成它需要完成的方式
import matplotlib.pyplot as plt
import numpy as np
plt.figure()
languages =['Python', 'SQL', 'Java', 'C++', 'JavaScript']
pos = np.arange(len(languages))
popularity = [56, 39, 34, 34, 29]
plt.bar(pos, popularity, align='center')
plt.xticks(pos, languages)
plt.ylabel('% Popularity')
plt.title('Top 5 Languages for Math & Data \nby % popularity on Stack Overflow', alpha=0.8)
# remove all the ticks (both axes), and tick labels on the Y axis
plt.tick_params(top='off', bottom='off', left='off', right='off', labelleft='off', labelbottom='on')
plt.show()
【问题讨论】:
-
plt.axis('off')去除蜱和刺。
标签: python-3.x pandas numpy matplotlib