Merge pull request #1664 from mortenpi/fix-pyplot-savefig
Fix savefig with latexstring for pyplot
This commit is contained in:
commit
b4944a6f81
@ -387,7 +387,7 @@ end
|
|||||||
function _initialize_backend(::PyPlotBackend)
|
function _initialize_backend(::PyPlotBackend)
|
||||||
@eval Main begin
|
@eval Main begin
|
||||||
import PyPlot, PyCall
|
import PyPlot, PyCall
|
||||||
import LaTeXStrings: latexstring
|
import LaTeXStrings
|
||||||
|
|
||||||
export PyPlot
|
export PyPlot
|
||||||
|
|
||||||
|
|||||||
@ -236,16 +236,17 @@ function add_pyfixedformatter(cbar, vals::AVec)
|
|||||||
cbar[:update_ticks]()
|
cbar[:update_ticks]()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin
|
||||||
function labelfunc(scale::Symbol, backend::PyPlotBackend)
|
function labelfunc(scale::Symbol, backend::PyPlotBackend)
|
||||||
if scale == :log10
|
if scale == :log10
|
||||||
x -> latexstring("10^{$x}")
|
x -> LaTeXStrings.latexstring("10^{$x}")
|
||||||
elseif scale == :log2
|
elseif scale == :log2
|
||||||
x -> latexstring("2^{$x}")
|
x -> LaTeXStrings.latexstring("2^{$x}")
|
||||||
elseif scale == :ln
|
elseif scale == :ln
|
||||||
x -> latexstring("e^{$x}")
|
x -> LaTeXStrings.latexstring("e^{$x}")
|
||||||
else
|
else
|
||||||
string
|
string
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user