Add support for levels keyword in PyPlot

This commit is contained in:
Sheehan Olver 2015-12-29 15:32:49 +11:00
parent ed7cc9b89e
commit c09545de64
3 changed files with 25 additions and 16 deletions

View File

@ -139,6 +139,7 @@ _seriesDefaults[:z] = nothing # depth for contour, surfa
_seriesDefaults[:zcolor] = nothing # value for color scale
# _seriesDefaults[:surface] = nothing
_seriesDefaults[:nlevels] = 15
_seriesDefaults[:levels] = nothing
_seriesDefaults[:orientation] = :vertical

View File

@ -338,10 +338,17 @@ function _add_series(pkg::PyPlotPackage, plt::Plot; kw...)
# and take the transpose of the surface matrix
x, y = d[:x], d[:y]
surf = d[:z].surf'
if d[:levels] != nothing
handle = plotfunc(x, y, surf; levels=d[:levels], extra_kwargs...)
if d[:fillrange] != nothing
handle = ax[:contourf](x, y, surf; levels=d[:levels], cmap = getPyPlotColorMap(d[:fillcolor], d[:fillalpha]))
end
else
handle = plotfunc(x, y, surf, d[:nlevels]; extra_kwargs...)
if d[:fillrange] != nothing
handle = ax[:contourf](x, y, surf, d[:nlevels]; cmap = getPyPlotColorMap(d[:fillcolor], d[:fillalpha]))
end
end
handle
elseif lt in (:surface,:wireframe)
x, y, z = if isa(d[:x], AMat) && isa(d[:y], AMat)

View File

@ -155,6 +155,7 @@ supportedArgs(::PyPlotPackage) = [
:grid,
# :surface,
:nlevels,
:levels,
:fillalpha,
:linealpha,
:markeralpha,