added latex formatter for ticks (solves #2042, #2147)

This commit is contained in:
Ben Ide 2019-09-18 19:09:43 -04:00
parent 2c3bffaf76
commit 3b962ffb08

View File

@ -218,6 +218,8 @@ function optimal_ticks_and_labels(sp::Subplot, axis::Axis, ticks = nothing)
map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, :plain)) map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, :plain))
elseif formatter == :scientific elseif formatter == :scientific
Showoff.showoff(unscaled_ticks, :scientific) Showoff.showoff(unscaled_ticks, :scientific)
elseif formatter == :latex
map(x -> string("\$", replace(convert_sci_unicode(x), '×' => "\\times"), "\$"), Showoff.showoff(unscaled_ticks, :auto))
else else
# there was an override for the formatter... use that on the unscaled ticks # there was an override for the formatter... use that on the unscaled ticks
map(formatter, unscaled_ticks) map(formatter, unscaled_ticks)