change gr legend marker for ribbon

This commit is contained in:
Daniel Schwabeneder 2017-07-02 18:32:34 +02:00
parent dbc7bc4253
commit 155634ef34
2 changed files with 8 additions and 2 deletions

View File

@ -1049,7 +1049,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
should_add_to_legend(series) || continue
st = series[:seriestype]
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])
elseif st == :shape || series[:fillrange] != nothing
gr_set_fill(series[:fillcolor]) #, series[:fillalpha])

View File

@ -493,10 +493,16 @@ function make_fillrange_from_ribbon(kw::KW)
y, rib = kw[:y], kw[:ribbon]
rib = wraptuple(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)
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)
axis_limits(sp[Symbol(letter, :axis)])
end