Format .jl files [skip ci] (#3780)
Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
parent
09d35d7b9f
commit
8b6073c088
@ -308,7 +308,10 @@ function gaston_seriesconf!(
|
||||
fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i))
|
||||
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
|
||||
if fr !== nothing # filled curves, but not filled curves with markers
|
||||
push!(curveconf, "w filledcurves fc $fc fs solid border lc $lc lw $lw dt $dt,'' w lines lc $lc lw $lw dt $dt")
|
||||
push!(
|
||||
curveconf,
|
||||
"w filledcurves fc $fc fs solid border lc $lc lw $lw dt $dt,'' w lines lc $lc lw $lw dt $dt",
|
||||
)
|
||||
elseif series[:markershape] == :none # simplepath
|
||||
push!(curveconf, "w lines lc $lc dt $dt lw $lw")
|
||||
else
|
||||
|
||||
@ -139,18 +139,7 @@ gr_set_arrowstyle(s::Symbol) = GR.setarrowstyle(
|
||||
gr_set_fillstyle(::Nothing) = GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
||||
function gr_set_fillstyle(s::Symbol)
|
||||
GR.setfillintstyle(GR.INTSTYLE_HATCH)
|
||||
GR.setfillstyle(get(
|
||||
(
|
||||
(/) = 9,
|
||||
(\) = 10,
|
||||
(|) = 7,
|
||||
(-) = 8,
|
||||
(+) = 11,
|
||||
(x) = 6,
|
||||
),
|
||||
s,
|
||||
9),
|
||||
)
|
||||
GR.setfillstyle(get(((/) = 9, (\) = 10, (|) = 7, (-) = 8, (+) = 11, (x) = 6), s, 9))
|
||||
end
|
||||
|
||||
# --------------------------------------------------------------------------------------
|
||||
|
||||
@ -1238,7 +1238,11 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
|
||||
opt,
|
||||
string(letter, "label style") => PGFPlotsX.Options(
|
||||
labelpos => nothing,
|
||||
"at" => string("{(ticklabel cs:", get((left = 0, right = 1), axis[:guidefonthalign], 0.5),")}"),
|
||||
"at" => string(
|
||||
"{(ticklabel cs:",
|
||||
get((left = 0, right = 1), axis[:guidefonthalign], 0.5),
|
||||
")}",
|
||||
),
|
||||
"anchor" => "near ticklabel",
|
||||
"font" => pgfx_font(axis[:guidefontsize], pgfx_thickness_scaling(sp)),
|
||||
"color" => cstr,
|
||||
@ -1300,10 +1304,7 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
|
||||
string("{\$", join(tick_labels, "\$,\$"), "\$}"),
|
||||
)
|
||||
elseif tick_labels isa Vector{LaTeXString}
|
||||
push!(
|
||||
opt,
|
||||
string(letter, "ticklabels") => join(tick_labels)
|
||||
)
|
||||
push!(opt, string(letter, "ticklabels") => join(tick_labels))
|
||||
end
|
||||
elseif axis[:showaxis]
|
||||
tick_labels =
|
||||
|
||||
@ -795,7 +795,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
edgecolor = py_color(fc, has_fs ? fa : la),
|
||||
facecolor = py_color(fc, has_fs ? 0 : fa),
|
||||
hatch = py_fillstyle(fs),
|
||||
linewidths = 0
|
||||
linewidths = 0,
|
||||
)
|
||||
push!(handles, handle)
|
||||
end
|
||||
@ -1499,7 +1499,10 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
|
||||
line_handle = pypatches."Patch"(
|
||||
edgecolor = py_color(single_color(lc), la),
|
||||
facecolor = py_color(single_color(fc), has_fs ? 0 : fa),
|
||||
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
|
||||
linewidth = py_thickness_scale(
|
||||
plt,
|
||||
clamp(get_linewidth(series), 0, 5),
|
||||
),
|
||||
linestyle = py_linestyle(series[:seriestype], ls),
|
||||
capstyle = "butt",
|
||||
)
|
||||
|
||||
@ -68,7 +68,14 @@ function rebuildUnicodePlot!(plt::Plot, width, height)
|
||||
end
|
||||
|
||||
# add a single series
|
||||
function addUnicodeSeries!(sp::Subplot{UnicodePlotsBackend}, o, series, addlegend::Bool, xlim, ylim)
|
||||
function addUnicodeSeries!(
|
||||
sp::Subplot{UnicodePlotsBackend},
|
||||
o,
|
||||
series,
|
||||
addlegend::Bool,
|
||||
xlim,
|
||||
ylim,
|
||||
)
|
||||
attrs = series.plotattributes
|
||||
st = attrs[:seriestype]
|
||||
|
||||
@ -79,7 +86,10 @@ function addUnicodeSeries!(sp::Subplot{UnicodePlotsBackend}, o, series, addlegen
|
||||
rng = range(0, 1, length = length(UnicodePlots.COLOR_MAP_DATA[:viridis]))
|
||||
cmap = [(red(c), green(c), blue(c)) for c in get(get_colorgradient(series), rng)]
|
||||
return UnicodePlots.heatmap(
|
||||
series[:z].surf; title = sp[:title], zlabel = sp[:colorbar_title], colormap = cmap
|
||||
series[:z].surf;
|
||||
title = sp[:title],
|
||||
zlabel = sp[:colorbar_title],
|
||||
colormap = cmap,
|
||||
)
|
||||
elseif st == :spy
|
||||
return UnicodePlots.spy(series[:z].surf; title = sp[:title])
|
||||
@ -149,12 +159,15 @@ function png(plt::Plot{UnicodePlotsBackend}, fn::AbstractString)
|
||||
return
|
||||
elseif Sys.islinux()
|
||||
run(`clear`)
|
||||
gui(plt); println()
|
||||
gui(plt)
|
||||
println()
|
||||
run(`import -window $(ENV["WINDOWID"]) $fn`)
|
||||
return
|
||||
end
|
||||
|
||||
error("Can only savepng on MacOS or Linux with UnicodePlots (though even then I wouldn't do it)")
|
||||
error(
|
||||
"Can only savepng on MacOS or Linux with UnicodePlots (though even then I wouldn't do it)",
|
||||
)
|
||||
end
|
||||
|
||||
# -------------------------------
|
||||
|
||||
@ -15,7 +15,9 @@ using RecipesBase
|
||||
using JSON
|
||||
|
||||
@testset "Infrastructure" begin
|
||||
@test_nowarn JSON.Parser.parse(String(read(joinpath(dirname(pathof(Plots)), "..", ".zenodo.json"))))
|
||||
@test_nowarn JSON.Parser.parse(
|
||||
String(read(joinpath(dirname(pathof(Plots)), "..", ".zenodo.json"))),
|
||||
)
|
||||
end
|
||||
|
||||
@testset "Plotly standalone" begin
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user