我有一个图表:

我希望图形xticks的订单是自定义的。从数据中可以制作20多个图表。有没有什么方法可以参考列表自定义直方图中条形图的顺序。
bar_data=["N/A", "I would probably talk to Yield Advisory", "I would definitely talk to Yield Advisory", "I already use Yield Advisory for this","I might talk to Yield Advisory"]发布于 2020-06-12 17:33:04
如果我没理解错您的问题,下面是解决方案https://matplotlib.org/3.1.0/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py
你只需要按照你想要的方式修改这段代码。
plt.xticks(x, ('Bill', 'Fred', 'Mary', 'Sue'))https://stackoverflow.com/questions/62337267
复制相似问题