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:
Morten Piibeleht 2018-08-16 11:03:21 +12:00
parent 9ae22a1ad7
commit 87627b8320

View File

@ -236,18 +236,19 @@ function add_pyfixedformatter(cbar, vals::AVec)
cbar[:update_ticks]()
end
@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
function py_mask_nans(z)