remove sp arg from get_linecolor and get_fillcolor
This commit is contained in:
parent
bfc26fa407
commit
b57abfd563
@ -1031,7 +1031,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
||||||
fr_from, fr_to = (is_2tuple(frng) ? frng : (y, frng))
|
fr_from, fr_to = (is_2tuple(frng) ? frng : (y, frng))
|
||||||
for (i, rng) in enumerate(segments_iterator)
|
for (i, rng) in enumerate(segments_iterator)
|
||||||
gr_set_fillcolor(get_fillcolor(sp, series, i))
|
gr_set_fillcolor(get_fillcolor(series, i))
|
||||||
fx = _cycle(x, vcat(rng, reverse(rng)))
|
fx = _cycle(x, vcat(rng, reverse(rng)))
|
||||||
fy = vcat(_cycle(fr_from,rng), _cycle(fr_to,reverse(rng)))
|
fy = vcat(_cycle(fr_from,rng), _cycle(fr_to,reverse(rng)))
|
||||||
series[:fillalpha] != nothing && GR.settransparency(series[:fillalpha])
|
series[:fillalpha] != nothing && GR.settransparency(series[:fillalpha])
|
||||||
@ -1042,7 +1042,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
# draw the line(s)
|
# draw the line(s)
|
||||||
if st in (:path, :straightline)
|
if st in (:path, :straightline)
|
||||||
for (i, rng) in enumerate(segments_iterator)
|
for (i, rng) in enumerate(segments_iterator)
|
||||||
gr_set_line(series[:linewidth], series[:linestyle], get_linecolor(sp, series, i)) #, series[:linealpha])
|
gr_set_line(series[:linewidth], series[:linestyle], get_linecolor(series, i)) #, series[:linealpha])
|
||||||
arrowside = isa(series[:arrow], Arrow) ? series[:arrow].side : :none
|
arrowside = isa(series[:arrow], Arrow) ? series[:arrow].side : :none
|
||||||
gr_polyline(x[rng], y[rng]; arrowside = arrowside)
|
gr_polyline(x[rng], y[rng]; arrowside = arrowside)
|
||||||
end
|
end
|
||||||
@ -1125,7 +1125,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
iter_segments(x, y, z)
|
iter_segments(x, y, z)
|
||||||
end
|
end
|
||||||
for (i, rng) in enumerate(segments_iterator)
|
for (i, rng) in enumerate(segments_iterator)
|
||||||
gr_set_line(series[:linewidth], series[:linestyle], get_linecolor(sp, series, i)) #, series[:linealpha])
|
gr_set_line(series[:linewidth], series[:linestyle], get_linecolor(series, i)) #, series[:linealpha])
|
||||||
GR.polyline3d(x[rng], y[rng], z[rng])
|
GR.polyline3d(x[rng], y[rng], z[rng])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1196,11 +1196,11 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
xseg, yseg = x[rng], y[rng]
|
xseg, yseg = x[rng], y[rng]
|
||||||
|
|
||||||
# draw the interior
|
# draw the interior
|
||||||
gr_set_fill(get_fillcolor(sp, series, i))
|
gr_set_fill(get_fillcolor(series, i))
|
||||||
GR.fillarea(xseg, yseg)
|
GR.fillarea(xseg, yseg)
|
||||||
|
|
||||||
# draw the shapes
|
# draw the shapes
|
||||||
gr_set_line(series[:linewidth], :solid, get_linecolor(sp, series, i))
|
gr_set_line(series[:linewidth], :solid, get_linecolor(series, i))
|
||||||
GR.polyline(xseg, yseg)
|
GR.polyline(xseg, yseg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1286,10 +1286,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
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], get_linecolor(sp, series)) #, series[:linealpha])
|
gr_set_line(series[:linewidth], series[:linestyle], get_linecolor(series)) #, series[:linealpha])
|
||||||
|
|
||||||
if (st == :shape || series[:fillrange] != nothing) && series[:ribbon] == nothing
|
if (st == :shape || series[:fillrange] != nothing) && series[:ribbon] == nothing
|
||||||
gr_set_fill(get_fillcolor(sp, series)) #, series[:fillalpha])
|
gr_set_fill(get_fillcolor(series)) #, series[:fillalpha])
|
||||||
l, r = xpos-0.07, xpos-0.01
|
l, r = xpos-0.07, xpos-0.01
|
||||||
b, t = ypos-0.4dy, ypos+0.4dy
|
b, t = ypos-0.4dy, ypos+0.4dy
|
||||||
x = [l, r, r, l, l]
|
x = [l, r, r, l, l]
|
||||||
|
|||||||
@ -602,26 +602,26 @@ function hascolorbar(sp::Subplot)
|
|||||||
hascbar
|
hascbar
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_linecolor(sp::Subplot, series::Series, i::Int = 1)
|
function get_linecolor(series::Series, i::Int = 1)
|
||||||
lc = series[:linecolor]
|
lc = series[:linecolor]
|
||||||
lz = series[:line_z]
|
lz = series[:line_z]
|
||||||
if lz == nothing
|
if lz == nothing
|
||||||
isa(lc, ColorGradient) ? lc : _cycle(lc, i)
|
isa(lc, ColorGradient) ? lc : _cycle(lc, i)
|
||||||
else
|
else
|
||||||
cmin, cmax = get_clims(sp)
|
cmin, cmax = get_clims(series[:subplot])
|
||||||
grad = isa(lc, ColorGradient) ? lc : cgrad()
|
grad = isa(lc, ColorGradient) ? lc : cgrad()
|
||||||
grad[clamp((_cycle(lz, i) - cmin) / (cmax - cmin), 0, 1)]
|
grad[clamp((_cycle(lz, i) - cmin) / (cmax - cmin), 0, 1)]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_fillcolor(sp::Subplot, series::Series, i::Int = 1)
|
function get_fillcolor(series::Series, i::Int = 1)
|
||||||
fc = series[:fillcolor]
|
fc = series[:fillcolor]
|
||||||
fz = series[:fill_z]
|
fz = series[:fill_z]
|
||||||
lz = series[:line_z]
|
lz = series[:line_z]
|
||||||
if fz == nothing && lz == nothing
|
if fz == nothing && lz == nothing
|
||||||
isa(fc, ColorGradient) ? fc : _cycle(fc, i)
|
isa(fc, ColorGradient) ? fc : _cycle(fc, i)
|
||||||
else
|
else
|
||||||
cmin, cmax = get_clims(sp)
|
cmin, cmax = get_clims(series[:subplot])
|
||||||
grad = isa(fc, ColorGradient) ? fc : cgrad()
|
grad = isa(fc, ColorGradient) ? fc : cgrad()
|
||||||
if fz != nothing
|
if fz != nothing
|
||||||
grad[clamp((_cycle(fz, i) - cmin) / (cmax - cmin), 0, 1)]
|
grad[clamp((_cycle(fz, i) - cmin) / (cmax - cmin), 0, 1)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user