From 5d5d8f073ae7c38d9a7b16e56e427c743706d297 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Thu, 2 Nov 2017 20:38:06 +0100 Subject: [PATCH 1/3] allow setting the linewidth for contour plots in GR --- src/backends/gr.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index ef539066..dfc726bd 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -4,7 +4,7 @@ # significant contributions by @jheinen @require Revise begin - Revise.track(Plots, joinpath(Pkg.dir("Plots"), "src", "backends", "gr.jl")) + Revise.track(Plots, joinpath(Pkg.dir("Plots"), "src", "backends", "gr.jl")) end const _gr_attr = merge_with_base_supported([ @@ -997,11 +997,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) if series[:fillrange] != nothing GR.surface(x, y, z, GR.OPTION_CELL_ARRAY) else + GR.setlinewidth(series[:linewidth]) GR.contour(x, y, h, z, 1000) end # create the colorbar of contour levels if cmap + gr_set_line(1, :solid, yaxis[:foreground_color_axis]) gr_set_viewport_cmap(sp) l = round.(Int32, 1000 + (h - ignorenan_minimum(h)) / (ignorenan_maximum(h) - ignorenan_minimum(h)) * 255) GR.setwindow(xmin, xmax, zmin, zmax) From 40282ae23ab55480b2acfe9e0d1465c7e6539b67 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 3 Nov 2017 10:02:16 +0100 Subject: [PATCH 2/3] allow setting the linestyle for contours on GR --- src/backends/gr.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index dfc726bd..9fc65c27 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -997,7 +997,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) if series[:fillrange] != nothing GR.surface(x, y, z, GR.OPTION_CELL_ARRAY) else - GR.setlinewidth(series[:linewidth]) + GR.setlinetype(gr_linetype[series[:linestyle]]) + width, height = gr_plot_size + GR.setlinewidth(max(0, series[:linewidth] / (sum(gr_plot_size) * 0.001))) GR.contour(x, y, h, z, 1000) end From 8dd264c4da66170043be667882ad0e8ba0dcc60f Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 3 Nov 2017 10:15:55 +0100 Subject: [PATCH 3/3] remove unnecessary line --- src/backends/gr.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 9fc65c27..7df19ff0 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -998,7 +998,6 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) GR.surface(x, y, z, GR.OPTION_CELL_ARRAY) else GR.setlinetype(gr_linetype[series[:linestyle]]) - width, height = gr_plot_size GR.setlinewidth(max(0, series[:linewidth] / (sum(gr_plot_size) * 0.001))) GR.contour(x, y, h, z, 1000) end