Format .jl files [skip ci] (#3927)
Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
parent
ec3a7ffaf2
commit
426774efcd
@ -228,7 +228,8 @@ end
|
|||||||
gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s))
|
gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s))
|
||||||
|
|
||||||
function gr_inqtext(x, y, s::AbstractString)
|
function gr_inqtext(x, y, s::AbstractString)
|
||||||
if (occursin('\\', s) || occursin("10^{", s)) && match(r".*\$[^\$]+?\$.*", String(s)) == nothing
|
if (occursin('\\', s) || occursin("10^{", s)) &&
|
||||||
|
match(r".*\$[^\$]+?\$.*", String(s)) == nothing
|
||||||
GR.inqtextext(x, y, s)
|
GR.inqtextext(x, y, s)
|
||||||
else
|
else
|
||||||
GR.inqtext(x, y, s)
|
GR.inqtext(x, y, s)
|
||||||
@ -238,7 +239,8 @@ end
|
|||||||
gr_text(x, y, s) = gr_text(x, y, string(s))
|
gr_text(x, y, s) = gr_text(x, y, string(s))
|
||||||
|
|
||||||
function gr_text(x, y, s::AbstractString)
|
function gr_text(x, y, s::AbstractString)
|
||||||
if (occursin('\\', s) || occursin("10^{", s)) && match(r".*\$[^\$]+?\$.*", String(s)) == nothing
|
if (occursin('\\', s) || occursin("10^{", s)) &&
|
||||||
|
match(r".*\$[^\$]+?\$.*", String(s)) == nothing
|
||||||
GR.textext(x, y, s)
|
GR.textext(x, y, s)
|
||||||
else
|
else
|
||||||
GR.text(x, y, s)
|
GR.text(x, y, s)
|
||||||
@ -573,7 +575,7 @@ function gr_draw_colorbar(cbar::GRColorbar, sp::Subplot, clims, viewport_plotare
|
|||||||
GR.setscale(2)
|
GR.setscale(2)
|
||||||
end
|
end
|
||||||
GR.axes(0, ztick, xmax, zmin, 0, 1, 0.005)
|
GR.axes(0, ztick, xmax, zmin, 0, 1, 0.005)
|
||||||
|
|
||||||
title = if isa(sp[:colorbar_title], PlotText)
|
title = if isa(sp[:colorbar_title], PlotText)
|
||||||
sp[:colorbar_title]
|
sp[:colorbar_title]
|
||||||
else
|
else
|
||||||
@ -998,7 +1000,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
|
|
||||||
# init the colorbar
|
# init the colorbar
|
||||||
cbar = GRColorbar()
|
cbar = GRColorbar()
|
||||||
|
|
||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
gr_add_series(sp, series)
|
gr_add_series(sp, series)
|
||||||
gr_update_colorbar!(cbar, series)
|
gr_update_colorbar!(cbar, series)
|
||||||
@ -2124,10 +2126,11 @@ function gr_draw_heatmap(series, x, y, z, clims)
|
|||||||
get_z_normalized.(z_log, log10.(clims)...), z_log
|
get_z_normalized.(z_log, log10.(clims)...), z_log
|
||||||
end
|
end
|
||||||
rgba = Int32[round(Int32, 1000 + _i * 255) for _i in z_normalized]
|
rgba = Int32[round(Int32, 1000 + _i * 255) for _i in z_normalized]
|
||||||
background_color_ind = gr_getcolorind(plot_color(series[:subplot][:background_color_inside]))
|
background_color_ind =
|
||||||
|
gr_getcolorind(plot_color(series[:subplot][:background_color_inside]))
|
||||||
for i in eachindex(rgba)
|
for i in eachindex(rgba)
|
||||||
if isnan(_z[i])
|
if isnan(_z[i])
|
||||||
rgba[i] = background_color_ind
|
rgba[i] = background_color_ind
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !ispolar(series)
|
if !ispolar(series)
|
||||||
|
|||||||
@ -1253,4 +1253,5 @@ const _attrsymbolcache = Dict{Symbol,Dict{Symbol,Symbol}}()
|
|||||||
get_attr_symbol(letter::Symbol, keyword::String) = get_attr_symbol(letter, Symbol(keyword))
|
get_attr_symbol(letter::Symbol, keyword::String) = get_attr_symbol(letter, Symbol(keyword))
|
||||||
get_attr_symbol(letter::Symbol, keyword::Symbol) = _attrsymbolcache[letter][keyword]
|
get_attr_symbol(letter::Symbol, keyword::Symbol) = _attrsymbolcache[letter][keyword]
|
||||||
|
|
||||||
texmath2unicode(s::AbstractString, pat=r"\$([^$]+)\$") = replace(s, pat => m->UnicodeFun.to_latex(m[2:(length(m)-1)]))
|
texmath2unicode(s::AbstractString, pat = r"\$([^$]+)\$") =
|
||||||
|
replace(s, pat => m -> UnicodeFun.to_latex(m[2:(length(m) - 1)]))
|
||||||
|
|||||||
@ -201,8 +201,10 @@ end
|
|||||||
Plots.process_clims(:auto)
|
Plots.process_clims(:auto)
|
||||||
|
|
||||||
@test (==)(
|
@test (==)(
|
||||||
Plots.texmath2unicode(raw"Equation $y = \alpha \cdot x + \beta$ and eqn $y = \sin(x)^2$"),
|
Plots.texmath2unicode(
|
||||||
raw"Equation y = α ⋅ x + β and eqn y = sin(x)²"
|
raw"Equation $y = \alpha \cdot x + \beta$ and eqn $y = \sin(x)^2$",
|
||||||
|
),
|
||||||
|
raw"Equation y = α ⋅ x + β and eqn y = sin(x)²",
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user