Merge branch 'tick-format' of https://github.com/yha/Plots.jl into tick-format

This commit is contained in:
yha 2020-08-12 16:05:23 +03:00
parent f23e6c224d
commit bd7f0dc8d4
2 changed files with 12 additions and 8 deletions

View File

@ -20,9 +20,13 @@ using UUIDs
# ---------------------------------------------------------------- # ----------------------------------------------------------------
function labelfunc(scale::Symbol, backend::PlotlyBackend) function labelfunc(scale::Symbol, backend::PlotlyBackend)
f = scale == :log10 ? x->"10<sup>$x</sup>" : identity texfunc = labelfunc_tex(scale)
# replace dash with \minus (U+2212) function (x)
x -> replace(f(x), "-" => "") tex_x = texfunc(x)
sup_x = replace( tex_x, r"\^{(.*)}"=>s"<sup>\1</sup>" )
# replace dash with \minus (U+2212)
replace(sup_x, "-" => "")
end
end end
function plotly_font(font::Font, color = font.color) function plotly_font(font::Font, color = font.color)

View File

@ -1069,7 +1069,7 @@ guidefont(ax::Axis) = font(
# --------------------------------------------------------------- # ---------------------------------------------------------------
# converts unicode scientific notation, as returned by Showoff, # converts unicode scientific notation, as returned by Showoff,
# to a tex-like format (supported by gr, pyplot, and gpfplot). # to a tex-like format (supported by gr, pyplot, and pgfplots).
function convert_sci_unicode(label::AbstractString) function convert_sci_unicode(label::AbstractString)
unicode_dict = Dict( unicode_dict = Dict(