changed heatmap to hist2d, see #147 for details

This commit is contained in:
Thomas Breloff 2016-03-09 15:26:30 -05:00
parent fd4dd13270
commit 6db06857ba
9 changed files with 29 additions and 26 deletions

View File

@ -33,6 +33,8 @@ export
bar!, bar!,
histogram, histogram,
histogram!, histogram!,
histogram2d,
histogram2d!,
density, density,
density!, density!,
heatmap, heatmap,
@ -149,6 +151,8 @@ bar(args...; kw...) = plot(args...; kw..., linetype = :bar)
bar!(args...; kw...) = plot!(args...; kw..., linetype = :bar) bar!(args...; kw...) = plot!(args...; kw..., linetype = :bar)
histogram(args...; kw...) = plot(args...; kw..., linetype = :hist) histogram(args...; kw...) = plot(args...; kw..., linetype = :hist)
histogram!(args...; kw...) = plot!(args...; kw..., linetype = :hist) histogram!(args...; kw...) = plot!(args...; kw..., linetype = :hist)
histogram2d(args...; kw...) = plot(args...; kw..., linetype = :hist2d)
histogram2d!(args...; kw...) = plot!(args...; kw..., linetype = :hist2d)
density(args...; kw...) = plot(args...; kw..., linetype = :density) density(args...; kw...) = plot(args...; kw..., linetype = :density)
density!(args...; kw...) = plot!(args...; kw..., linetype = :density) density!(args...; kw...) = plot!(args...; kw..., linetype = :density)
heatmap(args...; kw...) = plot(args...; kw..., linetype = :heatmap) heatmap(args...; kw...) = plot(args...; kw..., linetype = :heatmap)

View File

@ -10,7 +10,7 @@ const _allAxes = [:auto, :left, :right]
const _3dTypes = [:path3d, :scatter3d, :surface, :wireframe] const _3dTypes = [:path3d, :scatter3d, :surface, :wireframe]
const _allTypes = vcat([ const _allTypes = vcat([
:none, :line, :path, :steppre, :steppost, :sticks, :scatter, :none, :line, :path, :steppre, :steppost, :sticks, :scatter,
:heatmap, :hexbin, :hist, :density, :bar, :hline, :vline, :ohlc, :heatmap, :hexbin, :hist, :hist2d, :hist3d, :density, :bar, :hline, :vline, :ohlc,
:contour, :pie :contour, :pie
], _3dTypes) ], _3dTypes)
@compat const _typeAliases = Dict( @compat const _typeAliases = Dict(
@ -39,7 +39,6 @@ const _allTypes = vcat([
ishistlike(lt::Symbol) = lt in (:hist, :density) ishistlike(lt::Symbol) = lt in (:hist, :density)
islinelike(lt::Symbol) = lt in (:line, :path, :steppre, :steppost) islinelike(lt::Symbol) = lt in (:line, :path, :steppre, :steppost)
isheatmaplike(lt::Symbol) = lt in (:heatmap, :hexbin)
const _allStyles = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot] const _allStyles = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
@ -129,7 +128,7 @@ _seriesDefaults[:markerstrokecolor] = :match
_seriesDefaults[:markerstrokealpha] = nothing _seriesDefaults[:markerstrokealpha] = nothing
# _seriesDefaults[:ribbon] = nothing # _seriesDefaults[:ribbon] = nothing
# _seriesDefaults[:ribboncolor] = :match # _seriesDefaults[:ribboncolor] = :match
_seriesDefaults[:nbins] = 30 # number of bins for heatmaps and hists _seriesDefaults[:nbins] = 30 # number of bins for hists
_seriesDefaults[:smooth] = false # regression line? _seriesDefaults[:smooth] = false # regression line?
_seriesDefaults[:group] = nothing # groupby vector _seriesDefaults[:group] = nothing # groupby vector
# _seriesDefaults[:annotation] = nothing # annotation tuple(s)... (x,y,annotation) # _seriesDefaults[:annotation] = nothing # annotation tuple(s)... (x,y,annotation)

View File

@ -36,7 +36,7 @@ function getLineGeom(d::Dict)
xbins, ybins = maketuple(d[:nbins]) xbins, ybins = maketuple(d[:nbins])
if lt == :hexbin if lt == :hexbin
Gadfly.Geom.hexbin(xbincount = xbins, ybincount = ybins) Gadfly.Geom.hexbin(xbincount = xbins, ybincount = ybins)
elseif lt == :heatmap elseif lt == :hist2d
Gadfly.Geom.histogram2d(xbincount = xbins, ybincount = ybins) Gadfly.Geom.histogram2d(xbincount = xbins, ybincount = ybins)
elseif lt == :hist elseif lt == :hist
Gadfly.Geom.histogram(bincount = xbins) Gadfly.Geom.histogram(bincount = xbins)
@ -303,7 +303,7 @@ function addGadflySeries!(plt::Plot, d::Dict)
lt = d[:linetype] lt = d[:linetype]
if lt == :ohlc if lt == :ohlc
error("Haven't re-implemented after refactoring") error("Haven't re-implemented after refactoring")
elseif lt in (:heatmap, :hexbin) && (isa(d[:linecolor], ColorGradient) || isa(d[:linecolor], ColorFunction)) elseif lt in (:hist2d, :hexbin) && (isa(d[:linecolor], ColorGradient) || isa(d[:linecolor], ColorFunction))
push!(gplt.scales, Gadfly.Scale.ContinuousColorScale(p -> RGB(getColorZ(d[:linecolor], p)))) push!(gplt.scales, Gadfly.Scale.ContinuousColorScale(p -> RGB(getColorZ(d[:linecolor], p))))
elseif lt == :scatter && d[:markershape] == :none elseif lt == :scatter && d[:markershape] == :none
d[:markershape] = :ellipse d[:markershape] = :ellipse
@ -314,7 +314,7 @@ function addGadflySeries!(plt::Plot, d::Dict)
prepend!(layers, addGadflyMarker!(plt, length(gplt.layers), d, plt.plotargs, smooth...)) prepend!(layers, addGadflyMarker!(plt, length(gplt.layers), d, plt.plotargs, smooth...))
end end
lt in (:heatmap, :hexbin, :contour) || addToGadflyLegend(plt, d) lt in (:hist2d, :hexbin, :contour) || addToGadflyLegend(plt, d)
# now save the layers that apply to this series # now save the layers that apply to this series
d[:gadflylayers] = layers d[:gadflylayers] = layers

View File

@ -160,7 +160,7 @@ function gr_display(plt::Plot{GRPackage}, clear=true, update=true,
x, y = 1:size(p[:y], 1), p[:y] x, y = 1:size(p[:y], 1), p[:y]
elseif p[:linetype] in [:hist, :density] elseif p[:linetype] in [:hist, :density]
x, y = Base.hist(p[:y]) x, y = Base.hist(p[:y])
elseif p[:linetype] in [:heatmap, :hexbin] elseif p[:linetype] in [:hist2d, :hexbin]
E = zeros(length(p[:x]),2) E = zeros(length(p[:x]),2)
E[:,1] = p[:x] E[:,1] = p[:x]
E[:,2] = p[:y] E[:,2] = p[:y]
@ -423,7 +423,7 @@ function gr_display(plt::Plot{GRPackage}, clear=true, update=true,
GR.polyline([xy, xy], [ymin, ymax]) GR.polyline([xy, xy], [ymin, ymax])
end end
end end
elseif p[:linetype] in [:heatmap, :hexbin] elseif p[:linetype] in [:hist2d, :hexbin]
E = zeros(length(p[:x]),2) E = zeros(length(p[:x]),2)
E[:,1] = p[:x] E[:,1] = p[:x]
E[:,2] = p[:y] E[:,2] = p[:y]

View File

@ -296,7 +296,7 @@ function plotly_series(d::Dict; plot_index = nothing)
d_out[:type] = "bar" d_out[:type] = "bar"
d_out[:x], d_out[:y] = x, y d_out[:x], d_out[:y] = x, y
elseif lt == :heatmap elseif lt == :hist2d
d_out[:type] = "histogram2d" d_out[:type] = "histogram2d"
d_out[:x], d_out[:y] = x, y d_out[:x], d_out[:y] = x, y
if isa(d[:nbins], Tuple) if isa(d[:nbins], Tuple)

View File

@ -169,7 +169,7 @@ function getPyPlotFunction(plt::Plot, axis::Symbol, linetype::Symbol)
:density => :hist, :density => :hist,
:sticks => :bar, :sticks => :bar,
:bar => :bar, :bar => :bar,
:heatmap => :hexbin, :hist2d => :hexbin,
:hexbin => :hexbin, :hexbin => :hexbin,
:scatter => :scatter, :scatter => :scatter,
:contour => :contour, :contour => :contour,
@ -351,7 +351,7 @@ function _add_series(pkg::PyPlotPackage, plt::Plot; kw...)
extra_kwargs[:linewidth] = (lt == :sticks ? 0.1 : 0.9) extra_kwargs[:linewidth] = (lt == :sticks ? 0.1 : 0.9)
end end
elseif lt in (:heatmap, :hexbin) elseif lt in (:hist2d, :hexbin)
extra_kwargs[:gridsize] = d[:nbins] extra_kwargs[:gridsize] = d[:nbins]
extra_kwargs[:cmap] = getPyPlotColorMap(d[:linecolor]) extra_kwargs[:cmap] = getPyPlotColorMap(d[:linecolor])
@ -461,7 +461,7 @@ function _add_series(pkg::PyPlotPackage, plt::Plot; kw...)
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, :heatmap, :hexbin) elseif lt in (:scatter, :hist2d, :hexbin)
plotfunc(d[:x], d[:y]; extra_kwargs...) plotfunc(d[:x], d[:y]; extra_kwargs...)
else else
plotfunc(d[:x], d[:y]; extra_kwargs...)[1] plotfunc(d[:x], d[:y]; extra_kwargs...)[1]
@ -784,7 +784,7 @@ function addPyPlotLegend(plt::Plot, ax)
leg = plt.plotargs[:legend] leg = plt.plotargs[:legend]
if leg != :none if leg != :none
# gotta do this to ensure both axes are included # gotta do this to ensure both axes are included
args = filter(x -> !(x[:linetype] in (:hist,:density,:hexbin,:heatmap,:hline,:vline,:contour, :surface, :wireframe, :path3d, :scatter3d)), plt.seriesargs) args = filter(x -> !(x[:linetype] in (:hist,:density,:hexbin,:hist2d,:hline,:vline,:contour, :surface, :wireframe, :path3d, :scatter3d)), plt.seriesargs)
args = filter(x -> x[:label] != "", args) args = filter(x -> x[:label] != "", args)
if length(args) > 0 if length(args) > 0
leg = ax[:legend]([d[:serieshandle] for d in args], leg = ax[:legend]([d[:serieshandle] for d in args],

View File

@ -80,7 +80,7 @@ supportedArgs(::GadflyPackage) = [
] ]
supportedAxes(::GadflyPackage) = [:auto, :left] supportedAxes(::GadflyPackage) = [:auto, :left]
supportedTypes(::GadflyPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, supportedTypes(::GadflyPackage) = [:none, :line, :path, :steppre, :steppost, :sticks,
:scatter, :heatmap, :hexbin, :hist, :bar, :scatter, :hist2d, :hexbin, :hist, :bar,
:hline, :vline, :contour] :hline, :vline, :contour]
supportedStyles(::GadflyPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot] supportedStyles(::GadflyPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
supportedMarkers(::GadflyPackage) = vcat(_allMarkers, Shape) supportedMarkers(::GadflyPackage) = vcat(_allMarkers, Shape)
@ -166,7 +166,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, :heatmap, :hexbin, :hist, :density, :bar, :scatter, :hist2d, :hexbin, :hist, :density, :bar,
:hline, :vline, :contour, :path3d, :scatter3d, :surface, :wireframe] :hline, :vline, :contour, :path3d, :scatter3d, :surface, :wireframe]
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]
@ -240,7 +240,7 @@ supportedArgs(::GRPackage) = [
] ]
supportedAxes(::GRPackage) = _allAxes supportedAxes(::GRPackage) = _allAxes
supportedTypes(::GRPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, supportedTypes(::GRPackage) = [:none, :line, :path, :steppre, :steppost, :sticks,
:scatter, :heatmap, :hexbin, :hist, :density, :bar, :scatter, :hist2d, :hexbin, :hist, :density, :bar,
:hline, :vline, :contour, :path3d, :scatter3d, :surface, :hline, :vline, :contour, :path3d, :scatter3d, :surface,
:wireframe, :ohlc, :pie] :wireframe, :ohlc, :pie]
supportedStyles(::GRPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot] supportedStyles(::GRPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
@ -304,7 +304,7 @@ supportedArgs(::QwtPackage) = [
# :yflip, # :yflip,
# :z, # :z,
] ]
supportedTypes(::QwtPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, :scatter, :heatmap, :hexbin, :hist, :bar, :hline, :vline] supportedTypes(::QwtPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, :scatter, :hist2d, :hexbin, :hist, :bar, :hline, :vline]
supportedMarkers(::QwtPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5, :star8, :hexagon] supportedMarkers(::QwtPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5, :star8, :hexagon]
supportedScales(::QwtPackage) = [:identity, :log10] supportedScales(::QwtPackage) = [:identity, :log10]
subplotSupported(::QwtPackage) = true subplotSupported(::QwtPackage) = true
@ -363,7 +363,7 @@ supportedArgs(::UnicodePlotsPackage) = [
# :z, # :z,
] ]
supportedAxes(::UnicodePlotsPackage) = [:auto, :left] supportedAxes(::UnicodePlotsPackage) = [:auto, :left]
supportedTypes(::UnicodePlotsPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, :scatter, :heatmap, :hexbin, :hist, :bar, :hline, :vline] supportedTypes(::UnicodePlotsPackage) = [:none, :line, :path, :steppre, :steppost, :sticks, :scatter, :hist2d, :hexbin, :hist, :bar, :hline, :vline]
supportedStyles(::UnicodePlotsPackage) = [:auto, :solid] supportedStyles(::UnicodePlotsPackage) = [:auto, :solid]
supportedMarkers(::UnicodePlotsPackage) = [:none, :auto, :ellipse] supportedMarkers(::UnicodePlotsPackage) = [:none, :auto, :ellipse]
supportedScales(::UnicodePlotsPackage) = [:identity] supportedScales(::UnicodePlotsPackage) = [:identity]
@ -495,7 +495,7 @@ supportedArgs(::BokehPackage) = [
# :levels, # :levels,
] ]
supportedAxes(::BokehPackage) = [:auto, :left] supportedAxes(::BokehPackage) = [:auto, :left]
supportedTypes(::BokehPackage) = [:none, :path, :scatter] #,:steppre, :steppost, :sticks, :heatmap, :hexbin, :hist, :bar, :hline, :vline, :contour] supportedTypes(::BokehPackage) = [:none, :path, :scatter] #,:steppre, :steppost, :sticks, :hist2d, :hexbin, :hist, :bar, :hline, :vline, :contour]
supportedStyles(::BokehPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot] supportedStyles(::BokehPackage) = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
supportedMarkers(::BokehPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape) supportedMarkers(::BokehPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape)
supportedScales(::BokehPackage) = [:identity, :ln] #, :ln, :log2, :log10, :asinh, :sqrt] supportedScales(::BokehPackage) = [:identity, :ln] #, :ln, :log2, :log10, :asinh, :sqrt]
@ -562,7 +562,7 @@ supportedArgs(::PlotlyPackage) = [
] ]
supportedAxes(::PlotlyPackage) = [:auto, :left] supportedAxes(::PlotlyPackage) = [:auto, :left]
supportedTypes(::PlotlyPackage) = [:none, :line, :path, :scatter, :steppre, :steppost, supportedTypes(::PlotlyPackage) = [:none, :line, :path, :scatter, :steppre, :steppost,
:heatmap, :hist, :density, :bar, :contour, :surface, :path3d, :scatter3d, :hist2d, :hist, :density, :bar, :contour, :surface, :path3d, :scatter3d,
:pie] #,, :sticks, :hexbin, :hline, :vline] :pie] #,, :sticks, :hexbin, :hline, :vline]
supportedStyles(::PlotlyPackage) = [:auto, :solid, :dash, :dot, :dashdot] supportedStyles(::PlotlyPackage) = [:auto, :solid, :dash, :dot, :dashdot]
supportedMarkers(::PlotlyPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, supportedMarkers(::PlotlyPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross,
@ -632,7 +632,7 @@ supportedArgs(::PlotlyJSPackage) = [
] ]
supportedAxes(::PlotlyJSPackage) = [:auto, :left] supportedAxes(::PlotlyJSPackage) = [:auto, :left]
supportedTypes(::PlotlyJSPackage) = [:none, :line, :path, :scatter, :steppre, :steppost, supportedTypes(::PlotlyJSPackage) = [:none, :line, :path, :scatter, :steppre, :steppost,
:heatmap, :hist, :density, :bar, :contour, :surface, :path3d, :scatter3d, :hist2d, :hist, :density, :bar, :contour, :surface, :path3d, :scatter3d,
:pie] #,, :sticks, :hexbin, :hline, :vline] :pie] #,, :sticks, :hexbin, :hline, :vline]
supportedStyles(::PlotlyJSPackage) = [:auto, :solid, :dash, :dot, :dashdot] supportedStyles(::PlotlyJSPackage) = [:auto, :solid, :dash, :dot, :dashdot]
supportedMarkers(::PlotlyJSPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, supportedMarkers(::PlotlyJSPackage) = [:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross,
@ -700,7 +700,7 @@ supportedArgs(::GLVisualizePackage) = [
# :levels, # :levels,
] ]
supportedAxes(::GLVisualizePackage) = [:auto, :left] supportedAxes(::GLVisualizePackage) = [:auto, :left]
supportedTypes(::GLVisualizePackage) = [:contour] #, :path, :scatter ,:steppre, :steppost, :sticks, :heatmap, :hexbin, :hist, :bar, :hline, :vline, :contour] supportedTypes(::GLVisualizePackage) = [:contour] #, :path, :scatter ,:steppre, :steppost, :sticks, :hist2d, :hexbin, :hist, :bar, :hline, :vline, :contour]
supportedStyles(::GLVisualizePackage) = [:auto, :solid] #, :dash, :dot, :dashdot, :dashdotdot] supportedStyles(::GLVisualizePackage) = [:auto, :solid] #, :dash, :dot, :dashdot, :dashdotdot]
supportedMarkers(::GLVisualizePackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape) supportedMarkers(::GLVisualizePackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape)
supportedScales(::GLVisualizePackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt] supportedScales(::GLVisualizePackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt]
@ -765,7 +765,7 @@ supportedArgs(::PGFPlotsPackage) = [
# :levels, # :levels,
] ]
supportedAxes(::PGFPlotsPackage) = [:auto, :left] supportedAxes(::PGFPlotsPackage) = [:auto, :left]
supportedTypes(::PGFPlotsPackage) = [:contour] #, :path, :scatter ,:steppre, :steppost, :sticks, :heatmap, :hexbin, :hist, :bar, :hline, :vline, :contour] supportedTypes(::PGFPlotsPackage) = [:contour] #, :path, :scatter ,:steppre, :steppost, :sticks, :hist2d, :hexbin, :hist, :bar, :hline, :vline, :contour]
supportedStyles(::PGFPlotsPackage) = [:auto, :solid] #, :dash, :dot, :dashdot, :dashdotdot] supportedStyles(::PGFPlotsPackage) = [:auto, :solid] #, :dash, :dot, :dashdot, :dashdotdot]
supportedMarkers(::PGFPlotsPackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape) supportedMarkers(::PGFPlotsPackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape)
supportedScales(::PGFPlotsPackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt] supportedScales(::PGFPlotsPackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt]

View File

@ -88,7 +88,7 @@ function _add_series(::WinstonPackage, plt::Plot; kw...)
## lintype :path, :step, :stepinverted, :sticks, :dots, :none, :heatmap, :hexbin, :hist, :bar ## lintype :path, :step, :stepinverted, :sticks, :dots, :none, :hist2d, :hexbin, :hist, :bar
if d[:linetype] == :none if d[:linetype] == :none
Winston.add(wplt, Winston.Points(d[:x], d[:y]; copy_remove(e, :kind)..., color=getColor(d[:markercolor]))) Winston.add(wplt, Winston.Points(d[:x], d[:y]; copy_remove(e, :kind)..., color=getColor(d[:markercolor])))
@ -123,7 +123,7 @@ function _add_series(::WinstonPackage, plt::Plot; kw...)
# elseif d[:linetype] == :dots # elseif d[:linetype] == :dots
# fn = Winston.XXX # fn = Winston.XXX
# elseif d[:linetype] == :heatmap # elseif d[:linetype] == :hist2d
# fn = Winston.XXX # fn = Winston.XXX
# elseif d[:linetype] == :hexbin # elseif d[:linetype] == :hexbin

View File

@ -127,7 +127,7 @@ end
"Sparsity plot... heatmap of non-zero values of a matrix" "Sparsity plot... heatmap of non-zero values of a matrix"
function spy{T<:Real}(y::AMat{T}; kw...) function spy{T<:Real}(y::AMat{T}; kw...)
I,J,V = findnz(y) I,J,V = findnz(y)
heatmap(J, I; leg=false, yflip=true, nbins=size(y), kw...) heatmap(J, I; leg=false, yflip=true, kw...)
end end
"Adds a+bx... straight line over the current plot" "Adds a+bx... straight line over the current plot"