filled legend marker for filled area in PGFPlots
This commit is contained in:
parent
8ba30c5453
commit
e498d091cd
@ -269,9 +269,14 @@ function pgf_series(sp::Subplot, series::Series)
|
|||||||
|
|
||||||
# add to legend?
|
# add to legend?
|
||||||
if i == 1 && sp[:legend] != :none && should_add_to_legend(series)
|
if i == 1 && sp[:legend] != :none && should_add_to_legend(series)
|
||||||
kw[:legendentry] = d[:label]
|
if d[:fillrange] != nothing
|
||||||
if st == :shape # || d[:fillrange] != nothing
|
# we add a series
|
||||||
push!(style, "area legend")
|
push!(series_collection, pgf_fill_legend_hack(d, args))
|
||||||
|
else
|
||||||
|
kw[:legendentry] = d[:label]
|
||||||
|
if st == :shape # || d[:fillrange] != nothing
|
||||||
|
push!(style, "area legend")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
push!(style, "forget plot")
|
push!(style, "forget plot")
|
||||||
@ -336,6 +341,25 @@ function pgf_fillrange_args(fillrange, x, y, z)
|
|||||||
return x_fill, y_fill, z_fill
|
return x_fill, y_fill, z_fill
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function pgf_fill_legend_hack(d, args)
|
||||||
|
style = []
|
||||||
|
kw = KW()
|
||||||
|
push!(style, pgf_linestyle(d, 1))
|
||||||
|
push!(style, pgf_marker(d, 1))
|
||||||
|
push!(style, pgf_fillstyle(d, 1))
|
||||||
|
push!(style, "area legend")
|
||||||
|
kw[:legendentry] = d[:label]
|
||||||
|
kw[:style] = join(style, ',')
|
||||||
|
st = d[:seriestype]
|
||||||
|
func = if st == :path3d
|
||||||
|
PGFPlots.Linear3
|
||||||
|
elseif st == :scatter
|
||||||
|
PGFPlots.Scatter
|
||||||
|
else
|
||||||
|
PGFPlots.Linear
|
||||||
|
end
|
||||||
|
return func(([arg[1]] for arg in args)...; kw...)
|
||||||
|
end
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user