Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Plots.jl 和 GR 后端制作条形图,并想询问如何使 x 轴显示文本标签而不是数字。基本上这就是我正在做的事情:
using Plots; gr() data = [1,2,3] labels = ["one","two","three"] bar(data, legend=false)
这将产生以下图:
如何在 x 轴上显示我的标签(“一”、“二”、“三”)而不是“1 2 3”?
谢谢!
答案(感谢 Tom!)是将标签作为 x 值传递(目前只能在 dev 分支上):
Pkg.checkout("Plots","dev") using Plots gr() data = [1,2,3] labels = ["one","two","three"] bar(labels, data, legend=false)