pyplot heatmap
This commit is contained in:
parent
8e4ff39738
commit
581fdfdfe0
@ -176,6 +176,7 @@ function getPyPlotFunction(plt::Plot, axis::Symbol, linetype::Symbol)
|
|||||||
:scatter3d => :scatter,
|
:scatter3d => :scatter,
|
||||||
:surface => :plot_surface,
|
:surface => :plot_surface,
|
||||||
:wireframe => :plot_wireframe,
|
:wireframe => :plot_wireframe,
|
||||||
|
:heatmap => :imshow,
|
||||||
# :surface => pycolors.pymember("LinearSegmentedColormap")[:from_list]
|
# :surface => pycolors.pymember("LinearSegmentedColormap")[:from_list]
|
||||||
)
|
)
|
||||||
return ax[get(fmap, linetype, :plot)]
|
return ax[get(fmap, linetype, :plot)]
|
||||||
@ -370,6 +371,12 @@ function _add_series(pkg::PyPlotPackage, plt::Plot; kw...)
|
|||||||
extra_kwargs[:linewidth] = d[:linewidth]
|
extra_kwargs[:linewidth] = d[:linewidth]
|
||||||
extra_kwargs[:edgecolor] = getPyPlotColor(d[:linecolor], d[:linealpha])
|
extra_kwargs[:edgecolor] = getPyPlotColor(d[:linecolor], d[:linealpha])
|
||||||
|
|
||||||
|
elseif lt == :heatmap
|
||||||
|
extra_kwargs[:cmap] = getPyPlotColorMap(d[:fillcolor], d[:fillalpha])
|
||||||
|
left, right = extrema(d[:x])
|
||||||
|
bottom, top = extrema(d[:y])
|
||||||
|
extra_kwargs[:extent] = left, right, bottom, top
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
extra_kwargs[:linestyle] = getPyPlotLineStyle(lt, d[:linestyle])
|
extra_kwargs[:linestyle] = getPyPlotLineStyle(lt, d[:linestyle])
|
||||||
@ -459,14 +466,21 @@ function _add_series(pkg::PyPlotPackage, plt::Plot; kw...)
|
|||||||
z = z'
|
z = z'
|
||||||
end
|
end
|
||||||
plotfunc(x, y, z; extra_kwargs...)
|
plotfunc(x, y, z; extra_kwargs...)
|
||||||
|
|
||||||
elseif lt in _3dTypes
|
elseif lt in _3dTypes
|
||||||
plotfunc(d[:x], d[:y], d[:z]; extra_kwargs...)
|
plotfunc(d[:x], d[:y], d[:z]; extra_kwargs...)
|
||||||
|
|
||||||
elseif lt in (:scatter, :hist2d, :hexbin)
|
elseif lt in (:scatter, :hist2d, :hexbin)
|
||||||
plotfunc(d[:x], d[:y]; extra_kwargs...)
|
plotfunc(d[:x], d[:y]; extra_kwargs...)
|
||||||
else
|
|
||||||
|
elseif lt == :heatmap
|
||||||
|
plotfunc(d[:z]; extra_kwargs...)
|
||||||
|
|
||||||
|
else # plot
|
||||||
plotfunc(d[:x], d[:y]; extra_kwargs...)[1]
|
plotfunc(d[:x], d[:y]; extra_kwargs...)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# smoothing
|
||||||
handleSmooth(plt, ax, d, d[:smooth])
|
handleSmooth(plt, ax, d, d[:smooth])
|
||||||
|
|
||||||
# add the colorbar legend
|
# add the colorbar legend
|
||||||
|
|||||||
@ -167,7 +167,7 @@ supportedArgs(::PyPlotPackage) = [
|
|||||||
supportedAxes(::PyPlotPackage) = _allAxes
|
supportedAxes(::PyPlotPackage) = _allAxes
|
||||||
supportedTypes(::PyPlotPackage) = [:none, :line, :path, :steppre, :steppost, #:sticks,
|
supportedTypes(::PyPlotPackage) = [:none, :line, :path, :steppre, :steppost, #:sticks,
|
||||||
:scatter, :hist2d, :hexbin, :hist, :density, :bar,
|
:scatter, :hist2d, :hexbin, :hist, :density, :bar,
|
||||||
:hline, :vline, :contour, :path3d, :scatter3d, :surface, :wireframe]
|
:hline, :vline, :contour, :path3d, :scatter3d, :surface, :wireframe, :heatmap]
|
||||||
supportedStyles(::PyPlotPackage) = [:auto, :solid, :dash, :dot, :dashdot]
|
supportedStyles(::PyPlotPackage) = [:auto, :solid, :dash, :dot, :dashdot]
|
||||||
# supportedMarkers(::PyPlotPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5, :hexagon]
|
# supportedMarkers(::PyPlotPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5, :hexagon]
|
||||||
supportedMarkers(::PyPlotPackage) = vcat(_allMarkers, Shape)
|
supportedMarkers(::PyPlotPackage) = vcat(_allMarkers, Shape)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user