2024-09-28 22:26:31 发布
网友
我想在xlim([])中放置一个单词数组来代替一系列数字。使用普通python和matplotlib。你知道吗
像这样:
ax.set_xlim(['week1', 'week2', 'week3', 'week4', 'week5', 'week6', 'week7', 'week8', 'week9', 'week10'])
实现这一目标的最佳方法是什么?你知道吗
你想要matplotlib.pyplot.xticks。比如:
matplotlib.pyplot.xticks
# set the locations and labels of the xticks plt.xticks( arange(10), ('week1', 'week2', 'week3', 'week4', 'week5', 'week6', 'week7', 'week8', 'week9', 'week10') )
其中,您需要的不是arange(10),而是数据的x值数组。你知道吗
arange(10)
你想要
matplotlib.pyplot.xticks
。比如:其中,您需要的不是
arange(10)
,而是数据的x值数组。你知道吗相关问题 更多 >
编程相关推荐