fix support for fill_z in pyplot
This commit is contained in:
parent
3236e06fb9
commit
199a3306db
@ -18,8 +18,7 @@ const _pyplot_attr = merge_with_base_supported([
|
|||||||
:guide, :lims, :ticks, :scale, :flip, :rotation,
|
:guide, :lims, :ticks, :scale, :flip, :rotation,
|
||||||
:tickfont, :guidefont, :legendfont,
|
:tickfont, :guidefont, :legendfont,
|
||||||
:grid, :legend, :colorbar,
|
:grid, :legend, :colorbar,
|
||||||
:marker_z,
|
:marker_z, :line_z, :fill_z,
|
||||||
:line_z,
|
|
||||||
:levels,
|
:levels,
|
||||||
:ribbon, :quiver, :arrow,
|
:ribbon, :quiver, :arrow,
|
||||||
:orientation,
|
:orientation,
|
||||||
@ -124,8 +123,8 @@ end
|
|||||||
py_colormap(c) = py_colormap(cgrad())
|
py_colormap(c) = py_colormap(cgrad())
|
||||||
|
|
||||||
|
|
||||||
function py_shading(c, z, α=nothing)
|
function py_shading(c, z)
|
||||||
cmap = py_colormap(c, α)
|
cmap = py_colormap(c)
|
||||||
ls = pycolors.pymember("LightSource")(270,45)
|
ls = pycolors.pymember("LightSource")(270,45)
|
||||||
ls[:shade](z, cmap, vert_exag=0.1, blend_mode="soft")
|
ls[:shade](z, cmap, vert_exag=0.1, blend_mode="soft")
|
||||||
end
|
end
|
||||||
@ -668,21 +667,16 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
x = repmat(x', length(y), 1)
|
x = repmat(x', length(y), 1)
|
||||||
y = repmat(y, 1, length(series[:x]))
|
y = repmat(y, 1, length(series[:x]))
|
||||||
end
|
end
|
||||||
# z = z'
|
|
||||||
z = transpose_z(series, z)
|
z = transpose_z(series, z)
|
||||||
if st == :surface
|
if st == :surface
|
||||||
if series[:marker_z] != nothing
|
if series[:fill_z] != nothing
|
||||||
extrakw[:facecolors] = py_shading(series[:fillcolor], series[:marker_z], series[:fillalpha])
|
# the surface colors are different than z-value
|
||||||
|
extrakw[:facecolors] = py_shading(series[:fillcolor], transpose_z(series, series[:fill_z].surf))
|
||||||
extrakw[:shade] = false
|
extrakw[:shade] = false
|
||||||
clims = sp[:clims]
|
|
||||||
if is_2tuple(clims)
|
|
||||||
isfinite(clims[1]) && (extrakw[:vmin] = clims[1])
|
|
||||||
isfinite(clims[2]) && (extrakw[:vmax] = clims[2])
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
extrakw[:cmap] = py_fillcolormap(series)
|
extrakw[:cmap] = py_fillcolormap(series)
|
||||||
needs_colorbar = true
|
|
||||||
end
|
end
|
||||||
|
needs_colorbar = true
|
||||||
end
|
end
|
||||||
handle = ax[st == :surface ? :plot_surface : :plot_wireframe](x, y, z;
|
handle = ax[st == :surface ? :plot_surface : :plot_wireframe](x, y, z;
|
||||||
label = series[:label],
|
label = series[:label],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user