From e0b7bdc1a57ca2d825275d9b4f56f0c077d4d98f Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Tue, 21 Aug 2018 17:21:06 +0200 Subject: [PATCH 1/5] Revert "Merge pull request #1155 from mkborregaard/newspy" This reverts commit b71cfce105b03014af9b6149453ad5b95952a831. --- src/recipes.jl | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index be27cdd4..10e5d165 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1035,21 +1035,23 @@ end @recipe function f(::Type{Val{:spy}}, x,y,z) yflip := true aspect_ratio := 1 - rs, cs, zs = findnz(z.surf) - newz = fill(NaN, size(z)...) - - for i in eachindex(zs) - newz[rs[i],cs[i]] = zs[i] + xlim := ignorenan_extrema(cs) + ylim := ignorenan_extrema(rs) + if plotattributes[:markershape] == :none + markershape := :circle end - - seriestype := :heatmap + if plotattributes[:markersize] == default(:markersize) + markersize := 1 + end + markerstrokewidth := 0 + marker_z := zs + label := "" + x := cs + y := rs + z := nothing + seriestype := :scatter grid --> false - framestyle --> :box - - x := x - y := y - z := Surface(newz) () end From c4233e28960f82b61d761eb2226147a3ba649e04 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Tue, 21 Aug 2018 17:43:03 +0200 Subject: [PATCH 2/5] larger markers --- src/recipes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index 10e5d165..ffa30aac 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1042,7 +1042,7 @@ end markershape := :circle end if plotattributes[:markersize] == default(:markersize) - markersize := 1 + markersize := 1.5 end markerstrokewidth := 0 marker_z := zs From 5c2bf5d76cff8f45a57bfa83bccfe38cb7095890 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Fri, 24 Aug 2018 09:05:47 +0200 Subject: [PATCH 3/5] Don't color points --- src/recipes.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index ffa30aac..3ad76b3d 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1024,9 +1024,13 @@ end @assert length(g.args) == 1 && typeof(g.args[1]) <: AbstractMatrix seriestype := :spy mat = g.args[1] - if length(unique(mat[mat .!= 0])) < 2 + lunique = length(unique(mat[mat .!= 0])) + if lunique == 2 legend --> nothing seriescolor --> cgrad([invisible(), fg_color(plotattributes)]) + elseif lunique < 2 + legend --> nothing + seriescolor --> fg_color(plotattributes) end n,m = size(mat) Plots.SliceIt, 1:m, 1:n, Surface(mat) @@ -1045,7 +1049,7 @@ end markersize := 1.5 end markerstrokewidth := 0 - marker_z := zs + #marker_z := zs label := "" x := cs y := rs From 91f51778f1a43abcd39cda8a4463549d65dec256 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Fri, 24 Aug 2018 10:06:03 +0200 Subject: [PATCH 4/5] Don't define invisible when two colors --- src/recipes.jl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 3ad76b3d..ad03d6b8 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1024,14 +1024,6 @@ end @assert length(g.args) == 1 && typeof(g.args[1]) <: AbstractMatrix seriestype := :spy mat = g.args[1] - lunique = length(unique(mat[mat .!= 0])) - if lunique == 2 - legend --> nothing - seriescolor --> cgrad([invisible(), fg_color(plotattributes)]) - elseif lunique < 2 - legend --> nothing - seriescolor --> fg_color(plotattributes) - end n,m = size(mat) Plots.SliceIt, 1:m, 1:n, Surface(mat) end @@ -1046,7 +1038,7 @@ end markershape := :circle end if plotattributes[:markersize] == default(:markersize) - markersize := 1.5 + markersize := 1 end markerstrokewidth := 0 #marker_z := zs From 9887892a923adc64a236ae1b3a9c015b456678e6 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Tue, 28 Aug 2018 09:55:15 +0200 Subject: [PATCH 5/5] reinstate marker_z --- src/recipes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index ad03d6b8..7e6b5252 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1041,7 +1041,7 @@ end markersize := 1 end markerstrokewidth := 0 - #marker_z := zs + marker_z := zs label := "" x := cs y := rs