Compare commits

..

12 Commits

Author SHA1 Message Date
Josef Heinen 8951526d0d Set minimum GR version 2019-01-07 13:26:08 +01:00
Michael Krabbe Borregaard 3e799fbe21 Merge pull request #1880 from jheinen/master
Added support for discrete contour plots
2019-01-06 11:30:33 +01:00
Josef Heinen 53e27dbc38 Added support for discrete contour plots 2019-01-06 11:24:45 +01:00
Michael Krabbe Borregaard 9985d303ce Merge pull request #1879 from wfrgra/round_axis_limits
stop default axis widen behaviour overriding axis limit rounding
2019-01-06 08:11:43 +01:00
Michael Krabbe Borregaard ba46299088 Fix stray srand in showtheme 2019-01-05 17:59:18 +01:00
wfrgra 9679eae662 stop default widen behaviour overriding axis limit rounding 2019-01-05 13:46:53 +11:00
Michael Krabbe Borregaard 7acb5a4bdb allow annotations to take a tuple and pass it to text 2019-01-02 17:39:28 +01:00
Michael Krabbe Borregaard d1428b8221 update news.md 2018-12-29 10:05:02 +01:00
Michael Krabbe Borregaard c59a361ab3 Merge pull request #1875 from pfitzseb/sp/fixtypo
PlotDisplay -> PlotsDisplay
2018-12-29 09:46:54 +01:00
Sebastian Pfitzner 8935728daa PlotDisplay -> PlotsDisplay 2018-12-29 09:34:53 +01:00
Michael Krabbe Borregaard 155ac91385 Merge pull request #1874 from pfitzseb/sp/displayfixagain
insert PlotDisplay directly after REPLDisplay
2018-12-27 11:22:12 +01:00
Sebastian Pfitzner 4403ed3860 insert PlotDisplay directly after REPLDisplay 2018-12-27 10:57:10 +01:00
8 changed files with 20 additions and 17 deletions
+3
View File
@@ -11,6 +11,9 @@
---
## (current master)
## 0.22.1
- push PlotsDisplay just after REPLDisplay
## 0.22.0
- deprecate GLVisualize
- allow 1-row and 1-column heatmaps
+1 -1
View File
@@ -13,4 +13,4 @@ JSON
NaNMath
Requires
Contour
GR 0.35.0
GR 0.37.0
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+5 -8
View File
@@ -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
+2 -2
View File
@@ -554,7 +554,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
@@ -569,7 +569,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
+6 -3
View File
@@ -1,3 +1,5 @@
using REPL
const use_local_dependencies = Ref(false)
function __init__()
@@ -10,13 +12,14 @@ function __init__()
k == :theme || default(k, v)
end
end
pushdisplay(PlotsDisplay())
insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotsDisplay())
atreplinit(i -> begin
if PlotDisplay() in Base.Multimedia.displays
while PlotsDisplay() in Base.Multimedia.displays
popdisplay(PlotsDisplay())
end
pushdisplay(PlotsDisplay())
insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotsDisplay())
end)
@require HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" include(joinpath(@__DIR__, "backends", "hdf5.jl"))
+1 -1
View File
@@ -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