This commit is contained in:
Samuel S. Watson 2019-01-07 09:26:37 -06:00
commit 8c27064fc1
6 changed files with 11 additions and 14 deletions

View File

@ -13,4 +13,4 @@ JSON
NaNMath NaNMath
Requires Requires
Contour Contour
GR 0.35.0 GR 0.37.0

View File

@ -5,7 +5,7 @@ _current_plots_version = v"0.20.6"
using Reexport using Reexport
import StaticArrays import StaticArrays
using Dates, Printf, Statistics, Base64, LinearAlgebra using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
import SparseArrays: findnz import SparseArrays: findnz
@reexport using RecipesBase @reexport using RecipesBase

View File

@ -459,7 +459,7 @@ const _widen_seriestypes = (:line, :path, :steppre, :steppost, :sticks, :scatter
function default_should_widen(axis::Axis) function default_should_widen(axis::Axis)
should_widen = false should_widen = false
if !is_2tuple(axis[:lims]) if !(is_2tuple(axis[:lims]) || axis[:lims] == :round)
for sp in axis.sps for sp in axis.sps
for series in series_list(sp) for series in series_list(sp)
if series.plotattributes[:seriestype] in _widen_seriestypes if series.plotattributes[:seriestype] in _widen_seriestypes

View File

@ -1029,16 +1029,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
else else
h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2] h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2]
end 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 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 else
GR.setlinetype(gr_linetype[get_linestyle(series)]) coff = plot_color(series[:linecolor]) == [plot_color(:black)] ? 0 : 1000
GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001))) GR.contour(x, y, h, z, coff + (series[:contour_labels] == true ? 1 : 0))
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
end end
# create the colorbar of contour levels # create the colorbar of contour levels

View File

@ -600,7 +600,7 @@ function process_annotation(sp::Subplot, xs, ys, labs, font = font())
alphabet = "abcdefghijklmnopqrstuvwxyz" alphabet = "abcdefghijklmnopqrstuvwxyz"
push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font)))
else 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
end end
anns anns
@ -615,7 +615,7 @@ function process_annotation(sp::Subplot, positions::Union{AVec{Symbol},Symbol},
alphabet = "abcdefghijklmnopqrstuvwxyz" alphabet = "abcdefghijklmnopqrstuvwxyz"
push!(anns, (pos, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) push!(anns, (pos, text(string("(", alphabet[sp[:subplot_index]], ")"), font)))
else 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
end end
anns anns

View File

@ -100,7 +100,7 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
end end
end end
srand(1) Random.seed!(1)
label := "" label := ""
colorbar := false colorbar := false