diff --git a/REQUIRE b/REQUIRE index aae86c2c..a6b2ed11 100644 --- a/REQUIRE +++ b/REQUIRE @@ -13,4 +13,4 @@ JSON NaNMath Requires Contour -GR 0.35.0 +GR 0.37.0 diff --git a/src/Plots.jl b/src/Plots.jl index cd63204a..fb93c45f 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -5,7 +5,7 @@ _current_plots_version = v"0.20.6" using Reexport import StaticArrays -using Dates, Printf, Statistics, Base64, LinearAlgebra +using Dates, Printf, Statistics, Base64, LinearAlgebra, Random import SparseArrays: findnz @reexport using RecipesBase diff --git a/src/axes.jl b/src/axes.jl index 6f00a27a..1b2f693b 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -459,7 +459,7 @@ const _widen_seriestypes = (:line, :path, :steppre, :steppost, :sticks, :scatter function default_should_widen(axis::Axis) should_widen = false - if !is_2tuple(axis[:lims]) + if !(is_2tuple(axis[:lims]) || axis[:lims] == :round) for sp in axis.sps for series in series_list(sp) if series.plotattributes[:seriestype] in _widen_seriestypes diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 505ad39f..1d4fbca6 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1029,16 +1029,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) else h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2] end + GR.setlinetype(gr_linetype[get_linestyle(series)]) + GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001))) if series[:fillrange] != nothing - GR.surface(x, y, z, GR.OPTION_CELL_ARRAY) + GR.contourf(x, y, h, z, series[:contour_labels] == true ? 1 : 0) else - GR.setlinetype(gr_linetype[get_linestyle(series)]) - GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001))) - if plot_color(series[:linecolor]) == [plot_color(:black)] - GR.contour(x, y, h, z, 0 + (series[:contour_labels] == true ? 1 : 0)) - else - GR.contour(x, y, h, z, 1000 + (series[:contour_labels] == true ? 1 : 0)) - end + coff = plot_color(series[:linecolor]) == [plot_color(:black)] ? 0 : 1000 + GR.contour(x, y, h, z, coff + (series[:contour_labels] == true ? 1 : 0)) end # create the colorbar of contour levels diff --git a/src/components.jl b/src/components.jl index 198ba018..13d75a1e 100644 --- a/src/components.jl +++ b/src/components.jl @@ -600,7 +600,7 @@ function process_annotation(sp::Subplot, xs, ys, labs, font = font()) alphabet = "abcdefghijklmnopqrstuvwxyz" push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) else - push!(anns, (x, y, isa(lab, PlotText) ? lab : text(lab, font))) + push!(anns, (x, y, isa(lab, PlotText) ? lab : isa(lab, Tuple) ? text(lab...) : text(lab, font))) end end anns @@ -615,7 +615,7 @@ function process_annotation(sp::Subplot, positions::Union{AVec{Symbol},Symbol}, alphabet = "abcdefghijklmnopqrstuvwxyz" push!(anns, (pos, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) else - push!(anns, (pos, isa(lab, PlotText) ? lab : text(lab, font))) + push!(anns, (pos, isa(lab, PlotText) ? lab : isa(lab, Tuple) ? text(lab...) : text(lab, font))) end end anns diff --git a/src/themes.jl b/src/themes.jl index da313498..592d0a78 100644 --- a/src/themes.jl +++ b/src/themes.jl @@ -100,7 +100,7 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func end end - srand(1) + Random.seed!(1) label := "" colorbar := false