Wrap latexstring use in an at-require
latexstring comes from the LaTeXStrings package, which is conditionally loaded by pyplot(). Fix #1659.
This commit is contained in:
parent
9ae22a1ad7
commit
87627b8320
@ -236,17 +236,18 @@ function add_pyfixedformatter(cbar, vals::AVec)
|
||||
cbar[:update_ticks]()
|
||||
end
|
||||
|
||||
|
||||
function labelfunc(scale::Symbol, backend::PyPlotBackend)
|
||||
@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin
|
||||
function labelfunc(scale::Symbol, backend::PyPlotBackend)
|
||||
if scale == :log10
|
||||
x -> latexstring("10^{$x}")
|
||||
x -> LaTeXStrings.latexstring("10^{$x}")
|
||||
elseif scale == :log2
|
||||
x -> latexstring("2^{$x}")
|
||||
x -> LaTeXStrings.latexstring("2^{$x}")
|
||||
elseif scale == :ln
|
||||
x -> latexstring("e^{$x}")
|
||||
x -> LaTeXStrings.latexstring("e^{$x}")
|
||||
else
|
||||
string
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@require PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" begin
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user