Gaston: allow additional series

This commit is contained in:
t-bltg 2021-08-01 00:59:02 +02:00 committed by GitHub
parent 40cc74bea6
commit 8ebe9e8204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,8 +200,9 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
if gsp.dims == 2 && z === nothing if gsp.dims == 2 && z === nothing
for seg series_segments(series, st; check=true) for seg series_segments(series, st; check=true)
i, rng = seg.attr_index, seg.range i, rng = seg.attr_index, seg.range
seriesconf = gaston_seriesconf!(sp, series, i) for sc gaston_seriesconf!(sp, series, i)
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, nothing, seriesconf)) push!(curves, Gaston.Curve(x[rng], y[rng], nothing, nothing, sc))
end
end end
else else
seriesconf = gaston_seriesconf!(sp, series, 1) seriesconf = gaston_seriesconf!(sp, series, 1)
@ -220,7 +221,9 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
end end
end end
end end
push!(curves, Gaston.Curve(x, y, z, nothing, seriesconf)) for sc gaston_seriesconf!(sp, series, 1)
push!(curves, Gaston.Curve(x, y, z, nothing, sc))
end
end end
for c curves for c curves
@ -267,8 +270,8 @@ function gaston_seriesconf!(sp::Subplot{GastonBackend}, series::Series, i::Int)
tc: textcolor tc: textcolor
w: with w: with
=# =#
gsp = sp.o; curveconf = String[] gsp = sp.o; st = series[:seriestype]; extra = []
st = series[:seriestype] curveconf = String[should_add_to_legend(series) ? "title '$(series[:label])'" : "notitle"]
clims = get_clims(sp, series) clims = get_clims(sp, series)
if st (:scatter, :scatter3d) if st (:scatter, :scatter3d)
@ -287,12 +290,17 @@ function gaston_seriesconf!(sp::Subplot{GastonBackend}, series::Series, i::Int)
fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i)) fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i))
lc, _ = gaston_lc_ls_lw(series, clims, i) lc, _ = gaston_lc_ls_lw(series, clims, i)
push!(curveconf, "w filledcurves fc $fc fs solid border lc $lc") push!(curveconf, "w filledcurves fc $fc fs solid border lc $lc")
elseif st == :steppre elseif st (:steppre, :stepmid, :steppost)
push!(curveconf, "w fsteps") step = if st == :steppre
elseif st == :stepmid "fsteps"
push!(curveconf, "w histeps") elseif st == :stepmid
elseif st == :steppost "histeps"
push!(curveconf, "w steps") elseif st == :steppost
"steps"
end
push!(curveconf, "w $step")
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
push!(extra, "w points lc $lc dt $dt lw $lw notitle")
elseif st == :image elseif st == :image
palette = gaston_palette(series[:seriescolor]) palette = gaston_palette(series[:seriescolor])
gsp.axesconf *= "\nset palette model RGB defined $palette" gsp.axesconf *= "\nset palette model RGB defined $palette"
@ -315,8 +323,7 @@ function gaston_seriesconf!(sp::Subplot{GastonBackend}, series::Series, i::Int)
@warn "Gaston: $st is not implemented yet" @warn "Gaston: $st is not implemented yet"
end end
push!(curveconf, should_add_to_legend(series) ? "title '$(series[:label])'" : "notitle") return [join(curveconf, " "), extra...]
return join(curveconf, " ")
end end
function gaston_parse_axes_args( function gaston_parse_axes_args(