change gr legend marker for ribbon
This commit is contained in:
parent
dbc7bc4253
commit
155634ef34
@ -1049,7 +1049,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
should_add_to_legend(series) || continue
|
should_add_to_legend(series) || continue
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
gr_set_line(series[:linewidth], series[:linestyle], series[:linecolor]) #, series[:linealpha])
|
gr_set_line(series[:linewidth], series[:linestyle], series[:linecolor]) #, series[:linealpha])
|
||||||
if st == :path && series[:fillrange] == nothing
|
if st == :path && (series[:fillrange] == nothing || has_ribbon(series))
|
||||||
GR.polyline([xpos - 0.07, xpos - 0.01], [ypos, ypos])
|
GR.polyline([xpos - 0.07, xpos - 0.01], [ypos, ypos])
|
||||||
elseif st == :shape || series[:fillrange] != nothing
|
elseif st == :shape || series[:fillrange] != nothing
|
||||||
gr_set_fill(series[:fillcolor]) #, series[:fillalpha])
|
gr_set_fill(series[:fillcolor]) #, series[:fillalpha])
|
||||||
|
|||||||
@ -493,10 +493,16 @@ function make_fillrange_from_ribbon(kw::KW)
|
|||||||
y, rib = kw[:y], kw[:ribbon]
|
y, rib = kw[:y], kw[:ribbon]
|
||||||
rib = wraptuple(rib)
|
rib = wraptuple(rib)
|
||||||
rib1, rib2 = -first(rib), last(rib)
|
rib1, rib2 = -first(rib), last(rib)
|
||||||
kw[:ribbon] = nothing
|
# kw[:ribbon] = nothing
|
||||||
kw[:fillrange] = make_fillrange_side(y, rib1), make_fillrange_side(y, rib2)
|
kw[:fillrange] = make_fillrange_side(y, rib1), make_fillrange_side(y, rib2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# check if series has a ribbon
|
||||||
|
function has_ribbon(series::Series)
|
||||||
|
series[:ribbon] == nothing && return false
|
||||||
|
return series[:ribbon] > 0
|
||||||
|
end
|
||||||
|
|
||||||
function get_sp_lims(sp::Subplot, letter::Symbol)
|
function get_sp_lims(sp::Subplot, letter::Symbol)
|
||||||
axis_limits(sp[Symbol(letter, :axis)])
|
axis_limits(sp[Symbol(letter, :axis)])
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user