Replace × with \times for PGFPlots.

This commit is contained in:
Andrew Palugniok 2018-04-08 20:59:21 +01:00
parent 91cd6c1954
commit 8abd70bed8

View File

@ -425,8 +425,10 @@ function pgf_axis(sp::Subplot, letter)
push!(style, string(letter, "ticklabels = {\$", join(tick_labels,"\$,\$"), "\$}")) push!(style, string(letter, "ticklabels = {\$", join(tick_labels,"\$,\$"), "\$}"))
elseif axis[:showaxis] elseif axis[:showaxis]
tick_labels = ispolar(sp) && letter == :x ? [ticks[2][3:end]..., "0", "45"] : ticks[2] tick_labels = ispolar(sp) && letter == :x ? [ticks[2][3:end]..., "0", "45"] : ticks[2]
tick_labels = ( axis[:formatter] in (:scientific, :auto) ? if axis[:formatter] in (:scientific, :auto)
string.("\$", convert_sci_unicode.(tick_labels), "\$") : tick_labels ) tick_labels = string.("\$", convert_sci_unicode.(tick_labels), "\$")
tick_labels = replace.(tick_labels, "×", "\\times")
end
push!(style, string(letter, "ticklabels = {", join(tick_labels,","), "}")) push!(style, string(letter, "ticklabels = {", join(tick_labels,","), "}"))
else else
push!(style, string(letter, "ticklabels = {}")) push!(style, string(letter, "ticklabels = {}"))
@ -598,7 +600,6 @@ end
function _display(plt::Plot{PGFPlotsBackend}) function _display(plt::Plot{PGFPlotsBackend})
# prepare the object # prepare the object
PGFPlots.pushPGFPlotsPreamble("\\usepackage{fontspec}")
pgfplt = PGFPlots.plot(plt.o) pgfplt = PGFPlots.plot(plt.o)
# save an svg # save an svg