Using fillcolor for contour with fill=true.
Removed failed attempt at supporting single-color contours.
This commit is contained in:
parent
c2af1a0666
commit
44294306ce
@ -478,11 +478,8 @@ end
|
|||||||
|
|
||||||
const _gr_gradient_alpha = ones(256)
|
const _gr_gradient_alpha = ones(256)
|
||||||
|
|
||||||
function gr_set_gradient(c; ignore_colorant = true)
|
function gr_set_gradient(c)
|
||||||
@show c
|
grad = c isa ColorGradient ? c : cgrad()
|
||||||
gradient(g::ColorGradient) = g
|
|
||||||
gradient(c::Colorant) = ignore_colorant ? cgrad() : ColorGradient([c,c])
|
|
||||||
grad = gradient(c)
|
|
||||||
for (i,z) in enumerate(range(0, stop=1, length=256))
|
for (i,z) in enumerate(range(0, stop=1, length=256))
|
||||||
c = grad[z]
|
c = grad[z]
|
||||||
GR.setcolorrep(999+i, red(c), green(c), blue(c))
|
GR.setcolorrep(999+i, red(c), green(c), blue(c))
|
||||||
@ -962,10 +959,11 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
|
|
||||||
# update the current stored gradient
|
# update the current stored gradient
|
||||||
if st in (:surface, :heatmap)
|
if st in (:surface, :heatmap) ||
|
||||||
|
(st == :contour && series[:fillrange] !== nothing)
|
||||||
gr_set_gradient(series[:fillcolor]) #, series[:fillalpha])
|
gr_set_gradient(series[:fillcolor]) #, series[:fillalpha])
|
||||||
elseif st in (:contour, :wireframe)
|
elseif st in (:contour, :wireframe)
|
||||||
gr_set_gradient(series[:linecolor])#, ignore_colorant=false)
|
gr_set_gradient(series[:linecolor])
|
||||||
elseif series[:marker_z] != nothing
|
elseif series[:marker_z] != nothing
|
||||||
series[:markercolor] = gr_set_gradient(series[:markercolor])
|
series[:markercolor] = gr_set_gradient(series[:markercolor])
|
||||||
elseif series[:line_z] != nothing
|
elseif series[:line_z] != nothing
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user