Plotly + Julia + Latex

六眼飞鱼酱① 提交于 2021-02-10 05:09:27

问题


I would like to use latex with the Plotly backend. Look in this example: Even the x-axis and y-axis log scales are not formatted properly! Do you know how to do that?

Best,

v.

using Plots, LaTeXStrings
plotlyjs()
x =  10 .^ LinRange(-5,5,10)

plot(x, 1 ./ x, yaxis=:log, xaxis=:log, m = 2, xlabel="x", label="1/x",ylabel="f(x)")
plot!(x, 10 ./ x, m=2,label="10/x")
plot!(x, 1 ./ (x.^2), m=2, label=L"f(x)=$1/x^2$")
savefig("./test.png")


回答1:


Seems to work with the gr() backend, so I expect LaTeXString is not supported by the plotlyjs() backend.



来源:https://stackoverflow.com/questions/64791134/plotly-julia-latex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!