Implementation of filling the space between and under curves for gaston (#3755)
This commit is contained in:
parent
ded808477d
commit
7b8bd5b253
@ -225,13 +225,13 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
|
|||||||
gsp = sp.o
|
gsp = sp.o
|
||||||
x, y, z = series[:x], series[:y], series[:z]
|
x, y, z = series[:x], series[:y], series[:z]
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
|
|
||||||
curves = []
|
curves = []
|
||||||
if gsp.dims == 2 && z === nothing
|
if gsp.dims == 2 && z === nothing
|
||||||
for (n, seg) in enumerate(series_segments(series, st; check = true))
|
for (n, seg) in enumerate(series_segments(series, st; check = true))
|
||||||
i, rng = seg.attr_index, seg.range
|
i, rng = seg.attr_index, seg.range
|
||||||
|
fr =_cycle(series[:fillrange], 1:length(x[rng]))
|
||||||
for sc in gaston_seriesconf!(sp, series, i, n == 1)
|
for sc in gaston_seriesconf!(sp, series, i, n == 1)
|
||||||
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, nothing, sc))
|
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, fr, sc))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -304,8 +304,12 @@ function gaston_seriesconf!(
|
|||||||
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
||||||
push!(curveconf, "w points pt $pt ps $ps lc $mc")
|
push!(curveconf, "w points pt $pt ps $ps lc $mc")
|
||||||
elseif st ∈ (:path, :straightline, :path3d)
|
elseif st ∈ (:path, :straightline, :path3d)
|
||||||
|
fr = series[:fillrange]
|
||||||
|
fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i))
|
||||||
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
|
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
|
||||||
if series[:markershape] == :none # simplepath
|
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")
|
||||||
|
elseif series[:markershape] == :none # simplepath
|
||||||
push!(curveconf, "w lines lc $lc dt $dt lw $lw")
|
push!(curveconf, "w lines lc $lc dt $dt lw $lw")
|
||||||
else
|
else
|
||||||
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user