为什么 GR 不在 Julia 中显示轴标签
why isn't GR showing axis-labels in Julia
所以,我有一个如下所示的数组:
7-element Vector{Pair{Any, Any}}:
"Python hand-written" => 3104.096806
"Python- Built-in" => 2488.479628
"Julia hand-written" => 14.478426
"C" => 13.675734
"C ffast-math" => 7.390966
"Julia built-in" => 5.510281
"Python numpy" => 4.949694
我试图在水平条形图中绘制此数据,但由于某种原因我收到错误消息:
GKS: Rectangle definition is invalid routine SET_VIEWPORT
这是我的一段代码:
x = map(x->x[1], l_vec)
y = map(x->x[2], l_vec)
x_ticks = [0, 1, 2, 3,4, 5, 1000, 1500, 2000, 2500]
bar(x ,y , color="dark blue",
xaxis = ("time (ms)",:log10, 45),
yaxis = ("Languages"),
orientation= :horizontal,label = "" ,fillrange=1e-2, xticks =(x_ticks, x_ticks))
我不确定我是否理解这个错误...
问题是您要求在对数刻度的 x=0
处放置标签。
顺便说一句,我建议 against plotting bars on a logscale。
如果您真的想要对数刻度条,请删除 x_ticks
中的零,您将得到
所以,我有一个如下所示的数组:
7-element Vector{Pair{Any, Any}}:
"Python hand-written" => 3104.096806
"Python- Built-in" => 2488.479628
"Julia hand-written" => 14.478426
"C" => 13.675734
"C ffast-math" => 7.390966
"Julia built-in" => 5.510281
"Python numpy" => 4.949694
我试图在水平条形图中绘制此数据,但由于某种原因我收到错误消息:
GKS: Rectangle definition is invalid routine SET_VIEWPORT
这是我的一段代码:
x = map(x->x[1], l_vec)
y = map(x->x[2], l_vec)
x_ticks = [0, 1, 2, 3,4, 5, 1000, 1500, 2000, 2500]
bar(x ,y , color="dark blue",
xaxis = ("time (ms)",:log10, 45),
yaxis = ("Languages"),
orientation= :horizontal,label = "" ,fillrange=1e-2, xticks =(x_ticks, x_ticks))
我不确定我是否理解这个错误...
问题是您要求在对数刻度的 x=0
处放置标签。
顺便说一句,我建议 against plotting bars on a logscale。
如果您真的想要对数刻度条,请删除 x_ticks
中的零,您将得到