From 1fc0892551ad6571c127f3319b5628290614684c Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Mon, 15 Feb 2021 14:53:10 -0800 Subject: [PATCH 1/4] Allow extrakws for hexbin --- src/backends/pyplot.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 775faebd..eadaba88 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -372,8 +372,10 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) vmin, vmax = clims = get_clims(sp, series) # Dict to store extra kwargs - if st == :wireframe - extrakw = KW() # vmin, vmax cause an error for wireframe plot + if st == :wireframe || st == :hexbin + # vmin, vmax cause an error for wireframe plot + # We are not supporting clims for hexbin as calculation of bins is not trivial + extrakw = KW() else extrakw = KW(:vmin => vmin, :vmax => vmax) end @@ -517,7 +519,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) alpha = series[:fillalpha], cmap = py_fillcolormap(series), # applies to the pcolorfast object zorder = series[:series_plotindex], - # extrakw... # We are not supporting clims for hexbin as calculation of bins is not trivial + extrakw... ) push!(handles, handle) end From 0665ff907c214b40b9191ecfc5b3faeaee27dd6e Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Mon, 15 Feb 2021 14:53:22 -0800 Subject: [PATCH 2/4] Use semicolon --- src/backends/pyplot.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index eadaba88..cb4261ea 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -510,7 +510,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) end if st == :hexbin - handle = ax."hexbin"(x, y, + handle = ax."hexbin"(x, y; label = series[:label], C = series[:weights], gridsize = series[:bins]==:auto ? 100 : series[:bins], # 100 is the default value From 897a5eee87dd3c4ed01d61d7c2585ff037df22f2 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Mon, 15 Feb 2021 14:53:40 -0800 Subject: [PATCH 3/4] Allow edgecolors to override linewidth --- src/backends/pyplot.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index cb4261ea..9236b42a 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -510,12 +510,12 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) end if st == :hexbin + extrakw[:edgecolors] = get(series[:extra_kwargs], :edgecolors, py_color(get_linecolor(series))) handle = ax."hexbin"(x, y; label = series[:label], C = series[:weights], gridsize = series[:bins]==:auto ? 100 : series[:bins], # 100 is the default value linewidths = py_thickness_scale(plt, series[:linewidth]), - edgecolors = py_color(get_linecolor(series)), alpha = series[:fillalpha], cmap = py_fillcolormap(series), # applies to the pcolorfast object zorder = series[:series_plotindex], From 7989673eb4b6450bcc3ae50159e367aeef8830fe Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Mon, 15 Feb 2021 14:53:50 -0800 Subject: [PATCH 4/4] Allow mincnt --- src/backends/pyplot.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 9236b42a..dbf94987 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -510,6 +510,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) end if st == :hexbin + extrakw[:mincnt] = get(series[:extra_kwargs], :mincnt, nothing) extrakw[:edgecolors] = get(series[:extra_kwargs], :edgecolors, py_color(get_linecolor(series))) handle = ax."hexbin"(x, y; label = series[:label],