pyplot trisurface support

This commit is contained in:
Thomas Breloff 2016-04-26 14:20:07 -04:00
parent 6c9e818abd
commit b9d20142a2

View File

@ -492,6 +492,7 @@ function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW)
end end
if lt in (:surface, :wireframe) if lt in (:surface, :wireframe)
if typeof(z) <: AbstractMatrix
x, y, z = map(Array, (x,y,z)) x, y, z = map(Array, (x,y,z))
if !ismatrix(x) || !ismatrix(y) if !ismatrix(x) || !ismatrix(y)
x = repmat(x', length(y), 1) x = repmat(x', length(y), 1)
@ -512,6 +513,22 @@ function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW)
extrakw... extrakw...
) )
push!(handles, handle) push!(handles, handle)
elseif typeof(z) <: AbstractVector
# tri-surface plot (http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#tri-surface-plots)
handle = ax[:plot_trisurf](x, y, z;
label = d[:label],
zorder = plt.n,
cmap = pyfillcolormap(d),
linewidth = d[:linewidth],
edgecolor = pylinecolor(d)
)
push!(handles, handle)
needs_colorbar = true
else
error("Unsupported z type $(typeof(z)) for linetype=$lt")
end
end end
if lt == :heatmap if lt == :heatmap