Compare commits

...

61 Commits

Author SHA1 Message Date
Daniel Schwabeneder f478a649a0 Merge pull request #3213 from daschw/release
release 1.10.1
2021-01-07 00:25:14 +01:00
Daniel Schwabeneder 85ca402790 release 1.10.1 2021-01-06 23:02:48 +01:00
Lia Siegelman 2ebc97d92a fix for [BUG] #3135 mp4/mov animations can't be opened with QuickTime or Safari (#3209)
* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

* try a fix for codec animate function

Co-authored-by: Lia Siegelman <lsiegelman@ucsd.edu>
2021-01-05 21:40:21 +01:00
Daniel Schwabeneder 2bda216d8a Merge pull request #3207 from JuliaPlots/Test_SnoopCompile_AutoPR_refs/heads/master
[AUTO] Update precompiles
2021-01-04 17:57:26 +01:00
daschw ca7f69eaa3 Update precompile_*.jl file 2021-01-01 22:08:33 +00:00
Daniel Schwabeneder fcbfda10fb Merge pull request #3206 from JuliaPlots/Test_SnoopCompile_AutoPR_refs/heads/master
[AUTO] Update precompiles
2021-01-01 22:54:37 +01:00
Daniel Schwabeneder 51df476015 Merge pull request #3205 from daschw/pgfx-legendfont
respect legendfontcolor in pgfplotsx
2021-01-01 22:53:12 +01:00
daschw c08555a638 Update precompile_*.jl file 2020-12-31 08:35:42 +00:00
Daniel Schwabeneder 93825e2c86 Merge pull request #3201 from JuliaPlots/compathelper/new_version/2020-12-26-00-35-02-072-2106613790
CompatHelper: bump compat for "Reexport" to "1.0"
2020-12-31 09:21:30 +01:00
Daniel Schwabeneder c64bbf826c Merge pull request #3191 from daschw/datetimelims
allow more types in `lims!` functions
2020-12-31 09:20:52 +01:00
Daniel Schwabeneder 91608a6eab respect legendfontcolor in pgfplotsx 2020-12-31 09:17:39 +01:00
Simon Christ 8cc6d9d487 1.10.0 2020-12-29 22:03:03 +01:00
Daniel Schwabeneder 17f3faf672 simplify signature 2020-12-29 11:36:59 +01:00
github-actions[bot] 2e25d86daa CompatHelper: bump compat for "Reexport" to "1.0" 2020-12-26 00:35:07 +00:00
Rik Huijzer 0f349be952 Avoid comparing findfirst to nothing (#3200) 2020-12-23 23:35:11 +01:00
Daniel Schwabeneder 8f0d4c4145 Merge pull request #3184 from ThatcherC/component-tests
WIP: More component tests and some shorthands tests
2020-12-17 19:01:58 +01:00
Daniel Schwabeneder d61bbcce56 allow more types in lims! functions 2020-12-17 18:20:56 +01:00
Thatcher Chamberlin 2b376a0e4a Merge branch 'master' of https://github.com/JuliaPlots/Plots.jl into component-tests 2020-12-12 13:49:30 -05:00
Daniel Schwabeneder 882bb1b517 Merge pull request #3178 from jks-liu/pr_extra_mime_only_html
Set extra mime only when HTML format
2020-12-09 13:19:51 +01:00
Daniel Schwabeneder a403f9e44b Merge pull request #3180 from ThatcherC/date-xlims
Fix #1531, Let xlims be set to Dates or DateTimes
2020-12-09 13:18:00 +01:00
jaakkor2 0c4623873c Handle basex, basey, linthreshx, linthreshy deprecated in matplotlib 3.3 (#3183)
See https://matplotlib.org/3.3.0/api/api_changes.html
2020-12-08 17:50:30 +09:00
Thatcher Chamberlin d1671ea6f0 recheck coverage 2020-12-07 22:01:29 -05:00
Thatcher Chamberlin f905d6b697 Fixed rotate test and added series_annotation tests 2020-12-07 21:23:26 -05:00
Thatcher Chamberlin bc144b64c8 Added Shape rotation tests 2020-12-07 20:52:46 -05:00
Thatcher Chamberlin 10c94c739d Merge branch 'component-tests' of https://github.com/ThatcherC/Plots.jl into component-tests 2020-12-07 20:01:50 -05:00
Thatcher Chamberlin 38ada46a43 Added an auto-label test 2020-12-07 20:01:09 -05:00
Thatcher Chamberlin 0e73bcdc4e Added some tests for shorthands.jl 2020-12-07 20:00:55 -05:00
Thatcher Chamberlin e57a9349f6 Added font scaling tests 2020-12-07 11:21:51 -05:00
Thatcher Chamberlin 120d63f53f Merge branch 'date-xlims' of https://github.com/ThatcherC/Plots.jl into date-xlims 2020-12-07 10:53:55 -05:00
Thatcher Chamberlin b885687187 Now closing plots after display calls 2020-12-07 10:52:48 -05:00
Thatcher Chamberlin 80285061c9 Removed CI env check in Dates tests 2020-12-07 10:52:48 -05:00
Thatcher Chamberlin fa48e5c490 Moved Dates tests to be before backend tests 2020-12-07 10:52:48 -05:00
Thatcher Chamberlin 1fcdac4c9e Added second condition to skip display checks 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin 352df39026 Added checks around display checks to see if we're in CI 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin 9ab4c31d5c Added comments about possible alternate solutions 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin e9e6750481 Removed a println 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin bb3e053eb3 Added fix for case where lims are Date/DateTime s 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin 0bc41f22bb Added display checks to Date/DateTime tests to ensure they are able to be displayed 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin de03c3bca8 Added tests for plots where xlims are Dates and DateTimes 2020-12-07 10:51:49 -05:00
Thatcher Chamberlin f2b8e8512e Added font scaling tests 2020-12-07 10:10:43 -05:00
Daniel Schwabeneder 4c95ca5089 Merge pull request #3182 from ThatcherC/component-tests
WIP: Units Tests and Code Coverage for src/components.jl
2020-12-07 16:03:47 +01:00
Thatcher Chamberlin 9ba633bb59 retrigger checks 2020-12-07 08:26:48 -05:00
Thatcher Chamberlin 0b932ecb17 Added unit tests for src/components.jl 2020-12-06 22:39:56 -05:00
Thatcher Chamberlin f6627f3c5c Now closing plots after display calls 2020-12-06 18:54:53 -05:00
Thatcher Chamberlin 06a823a3be Removed CI env check in Dates tests 2020-12-06 15:21:15 -05:00
Thatcher Chamberlin 8c49652add Moved Dates tests to be before backend tests 2020-12-06 15:20:11 -05:00
Thatcher Chamberlin 0849471bf6 Added second condition to skip display checks 2020-12-06 14:50:16 -05:00
Thatcher Chamberlin e9a4231a5f Added checks around display checks to see if we're in CI 2020-12-06 14:30:11 -05:00
Thatcher Chamberlin c9b1de33f6 Added comments about possible alternate solutions 2020-12-06 13:35:25 -05:00
Thatcher Chamberlin 2013215ef2 Removed a println 2020-12-06 13:35:00 -05:00
Thatcher Chamberlin 8a3ee7bb75 Added fix for case where lims are Date/DateTime s 2020-12-06 13:30:14 -05:00
Thatcher Chamberlin eea73202e2 Added display checks to Date/DateTime tests to ensure they are able to be displayed 2020-12-06 13:27:30 -05:00
Thatcher Chamberlin cd450f49d4 Added tests for plots where xlims are Dates and DateTimes 2020-12-06 13:26:26 -05:00
Jks Liu 4b0d69b6a4 Set extra mine only when HTML format
Extra mine is not used by other format
2020-12-04 23:41:36 +08:00
wg030 02008284aa Update hdf5.jl (#3175) 2020-12-01 23:50:59 +01:00
Daniel Schwabeneder c857d59400 Merge pull request #3169 from JuliaPlots/Test_SnoopCompile_AutoPR_refs/heads/master
[AUTO] Update precompiles
2020-11-27 18:30:58 +01:00
Daniel Schwabeneder b5c8474e3f Merge pull request #3167 from jmert/offsetarrays_sticks
Support plotting `OffsetArray`s for `:sticks` series type
2020-11-27 18:27:06 +01:00
BeastyBlacksmith aafb34f5f5 Update precompile_*.jl file 2020-11-27 12:26:52 +00:00
Amin Yahyaabadi 8451b8da0f Fix CI + Use the triggering branch name in the SnoopCompile branch (#3082)
* Use the triggering branch name in the SnoopCompile branch

* fix set-env deprecation
2020-11-27 13:12:30 +01:00
Justin Willmert 94ca183a5b Support plotting OffsetArrays for :sticks series type 2020-11-26 12:54:37 -06:00
Simon Christ 2774b155b4 1.9.1 [skip ci] 2020-11-16 10:04:47 +01:00
19 changed files with 380 additions and 119 deletions
+3 -3
View File
@@ -41,10 +41,10 @@ jobs:
# TESTCMD
- name: Default TESTCMD
run: echo ::set-env name=TESTCMD::"julia"
run: echo "TESTCMD=julia" >> $GITHUB_ENV
- name: Ubuntu TESTCMD
if: startsWith(matrix.os,'ubuntu')
run: echo ::set-env name=TESTCMD::"xvfb-run --auto-servernum julia"
run: echo "TESTCMD=xvfb-run --auto-servernum julia" >> $GITHUB_ENV
# Generate precompile files
- name: Generating precompile files
@@ -78,7 +78,7 @@ jobs:
commit-message: Update precompile_*.jl file
title: "[AUTO] Update precompiles"
labels: SnoopCompile
branch: "SnoopCompile_AutoPR"
branch: "Test_SnoopCompile_AutoPR_${{ github.ref }}"
Skip:
+2 -2
View File
@@ -59,10 +59,10 @@ jobs:
# TESTCMD
- name: Default TESTCMD
run: echo ::set-env name=TESTCMD::"julia"
run: echo "TESTCMD=julia" >> $GITHUB_ENV
- name: Ubuntu TESTCMD
if: startsWith(matrix.os,'ubuntu')
run: echo ::set-env name=TESTCMD::"xvfb-run --auto-servernum julia"
run: echo "TESTCMD=xvfb-run --auto-servernum julia" >> $GITHUB_ENV
# Julia Dependencies
- name: Install Julia dependencies
+2 -2
View File
@@ -1,7 +1,7 @@
name = "Plots"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
author = ["Tom Breloff (@tbreloff)"]
version = "1.9.0"
version = "1.10.1"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -46,7 +46,7 @@ PlotThemes = "2"
PlotUtils = "1"
RecipesBase = "1"
RecipesPipeline = "0.2"
Reexport = "0.2"
Reexport = "0.2, 1.0"
Requires = "1"
Scratch = "1"
Showoff = "0.3.1"
+35 -7
View File
@@ -60,13 +60,16 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots._make_hist)),NamedTuple{(:normed, :weights),Tuple{Bool,Array{Int64,1}}},typeof(Plots._make_hist),Tuple{Array{Float64,1}},Symbol})
Base.precompile(Tuple{Core.kwftype(typeof(Plots._make_hist)),NamedTuple{(:normed, :weights),Tuple{Bool,Nothing}},typeof(Plots._make_hist),Tuple{Array{Float64,1},Array{Float64,1}},Int64})
Base.precompile(Tuple{Core.kwftype(typeof(Plots._make_hist)),NamedTuple{(:normed, :weights),Tuple{Bool,Nothing}},typeof(Plots._make_hist),Tuple{Array{Float64,1}},Symbol})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:formatter,),Tuple{Symbol}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:formatter,),Tuple{typeof(RecipesPipeline.datetimeformatter)}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:grid, :lims),Tuple{Bool,Tuple{Int64,Int64}}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:grid, :lims, :flip),Tuple{Bool,Tuple{Int64,Int64},Bool}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:gridlinewidth, :grid, :gridalpha, :gridstyle, :foreground_color_grid),Tuple{Int64,Bool,Float64,Symbol,RGBA{Float64}}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:guide,),Tuple{String}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:lims, :flip, :ticks, :guide),Tuple{Tuple{Int64,Int64},Bool,StepRange{Int64,Int64},String}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:lims,),Tuple{Tuple{Float64,Float64}}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:lims,),Tuple{Tuple{Int64,Float64}}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:rotation,),Tuple{Int64}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:scale, :guide),Tuple{Symbol,String}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.attr!)),NamedTuple{(:ticks,),Tuple{UnitRange{Int64}}},typeof(attr!),Plots.Axis})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.default)),NamedTuple{(:titlefont, :legendfontsize, :guidefont, :tickfont, :guide, :framestyle, :yminorgrid),Tuple{Tuple{Int64,String},Int64,Tuple{Int64,Symbol},Tuple{Int64,Symbol},String,Symbol,Bool}},typeof(default)})
@@ -79,8 +82,10 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.hline!)),Any,typeof(hline!),Any})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.lens!)),Any,typeof(lens!),Any,Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:alpha, :seriestype),Tuple{Float64,Symbol}},typeof(plot!),Array{GeometryBasics.Point{2,Float64},1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:alpha, :seriestype),Tuple{Float64,Symbol}},typeof(plot!),Plots.Plot{Plots.GRBackend},Array{GeometryBasics.Point{2,Float64},1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:annotation,),Tuple{Array{Tuple{Int64,Float64,Plots.PlotText},1}}},typeof(plot!)})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:line, :seriestype),Tuple{Tuple{Int64,Symbol,Float64,Array{Symbol,2}},Symbol}},typeof(plot!),Array{Float64,2}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:line, :seriestype),Tuple{Tuple{Int64,Symbol,Float64,Array{Symbol,2}},Symbol}},typeof(plot!),Plots.Plot{Plots.GRBackend},Array{Float64,2}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:lw, :color),Tuple{Int64,Symbol}},typeof(plot!),Function,Float64,Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:lw, :color),Tuple{Int64,Symbol}},typeof(plot!),Plots.Plot{Plots.GRBackend},Function,Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:marker, :series_annotations, :seriestype),Tuple{Tuple{Int64,Float64,Symbol},Array{Any,1},Symbol}},typeof(plot!),Plots.Plot{Plots.GRBackend},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Vararg{Any,N} where N})
@@ -91,6 +96,8 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:seriestype, :inset),Tuple{Symbol,Tuple{Int64,Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}}}},typeof(plot!),Plots.Plot{Plots.GRBackend},Array{Int64,1},Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:seriestype, :inset),Tuple{Symbol,Tuple{Int64,Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}}}},typeof(plot!),Plots.Plot{Plots.PlotlyBackend},Array{Int64,1},Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:seriestype,),Tuple{Symbol}},typeof(plot!),Array{Int64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:seriestype,),Tuple{Symbol}},typeof(plot!),Plots.Plot{Plots.GRBackend},Array{Int64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:title,),Tuple{String}},typeof(plot!),Plots.Plot{Plots.PlotlyBackend}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:title,),Tuple{String}},typeof(plot!)})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:w,),Tuple{Int64}},typeof(plot!),Plots.Plot{Plots.GRBackend},Array{Float64,1},Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:yaxis,),Tuple{Tuple{String,Symbol}}},typeof(plot!)})
@@ -134,7 +141,9 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:nbins, :show_empty_bins, :normed, :aspect_ratio, :seriestype),Tuple{Tuple{Int64,Int64},Bool,Bool,Int64,Symbol}},typeof(plot),Array{Complex{Float64},1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:proj, :m),Tuple{Symbol,Int64}},typeof(plot),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:projection, :seriestype),Tuple{Symbol,Symbol}},typeof(plot),Array{Int64,2}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:quiver, :seriestype),Tuple{Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1}},Symbol}},typeof(plot),Array{Float64,1},Array{Float64,1},Vararg{Array{Float64,1},N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:reg, :fill),Tuple{Bool,Tuple{Int64,Symbol}}},typeof(plot),Array{Float64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:ribbon,),Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}},typeof(plot),UnitRange{Int64}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:ribbon,),Tuple{Tuple{LinRange{Float64},LinRange{Float64}}}},typeof(plot),UnitRange{Int64}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:ribbon,),Tuple{typeof(sqrt)}},typeof(plot),UnitRange{Int64}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:seriestype, :markershape, :markersize, :color),Tuple{Array{Symbol,2},Array{Symbol,1},Int64,Array{Symbol,1}}},typeof(plot),Array{Float64,2}})
@@ -153,18 +162,26 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.portfoliocomposition)),Any,typeof(portfoliocomposition),Any,Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.scatter!)),Any,typeof(scatter!),Any,Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.scatter!)),Any,typeof(scatter!),Any})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.test_examples)),NamedTuple{(:skip, :disp),Tuple{Array{Int64,1},Bool}},typeof(test_examples),Symbol})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.test_examples)),NamedTuple{(:skip,),Tuple{Array{Int64,1}}},typeof(test_examples),Symbol})
Base.precompile(Tuple{Type{Plots.GridLayout},Int64,Vararg{Int64,N} where N})
Base.precompile(Tuple{Type{Shape},Array{Tuple{Float64,Float64},1}})
Base.precompile(Tuple{typeof(Base.Broadcast.copyto_nonleaf!),Array{PlotUtils.ContinuousColorGradient,1},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_colorgradient),Tuple{Base.Broadcast.Extruded{Array{Any,1},Tuple{Bool},Tuple{Int64}}}},Base.OneTo{Int64},Int64,Int64})
Base.precompile(Tuple{typeof(Base.Broadcast.copyto_nonleaf!),Array{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},1},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.contour_levels),Tuple{Base.Broadcast.Extruded{Array{Any,1},Tuple{Bool},Tuple{Int64}},Base.RefValue{Tuple{Float64,Float64}}}},Base.OneTo{Int64},Int64,Int64})
Base.precompile(Tuple{typeof(Base.Broadcast.materialize),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(Plots.contour_levels),Tuple{Array{Any,1},Base.RefValue{Tuple{Float64,Float64}}}}})
Base.precompile(Tuple{typeof(Base.Broadcast.materialize),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(Plots.get_linecolor),Tuple{Array{Any,1},Base.RefValue{Tuple{Float64,Float64}}}}})
Base.precompile(Tuple{typeof(Base.collect_similar),Array{AbstractLayout,2},Base.Generator{Array{AbstractLayout,2},typeof(Plots._update_min_padding!)}})
Base.precompile(Tuple{typeof(Base.vect),Tuple{Int64,Float64,Plots.PlotText},Vararg{Tuple{Int64,Float64,Plots.PlotText},N} where N})
Base.precompile(Tuple{typeof(Plots._bin_centers),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}})
Base.precompile(Tuple{typeof(Plots._cbar_unique),Array{Int64,1},String})
Base.precompile(Tuple{typeof(Plots._cbar_unique),Array{Nothing,1},String})
Base.precompile(Tuple{typeof(Plots._cbar_unique),Array{PlotUtils.ContinuousColorGradient,1},String})
Base.precompile(Tuple{typeof(Plots._cbar_unique),Array{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},1},String})
Base.precompile(Tuple{typeof(Plots._cbar_unique),Array{Symbol,1},String})
Base.precompile(Tuple{typeof(Plots._cycle),Array{Float64,1},Array{Int64,1}})
Base.precompile(Tuple{typeof(Plots._cycle),Array{Float64,1},StepRange{Int64,Int64}})
Base.precompile(Tuple{typeof(Plots._cycle),Array{Float64,1},UnitRange{Int64}})
Base.precompile(Tuple{typeof(Plots._cycle),Base.OneTo{Int64},Array{Int64,1}})
Base.precompile(Tuple{typeof(Plots._cycle),StepRange{Int64,Int64},Array{Int64,1}})
Base.precompile(Tuple{typeof(Plots._do_plot_show),Plots.Plot{Plots.GRBackend},Bool})
Base.precompile(Tuple{typeof(Plots._do_plot_show),Plots.Plot{Plots.PlotlyBackend},Bool})
@@ -172,14 +189,15 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot,Any,Any})
Base.precompile(Tuple{typeof(Plots._preprocess_barlike),RecipesPipeline.DefaultsDict,Base.OneTo{Int64},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots._preprocess_binlike),RecipesPipeline.DefaultsDict,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots._replace_markershape),Array{Symbol,1}})
Base.precompile(Tuple{typeof(Plots._update_min_padding!),Plots.GridLayout})
Base.precompile(Tuple{typeof(Plots._update_subplot_args),Plots.Plot{Plots.GRBackend},Plots.Subplot{Plots.GRBackend},Dict{Symbol,Any},Int64,Bool})
Base.precompile(Tuple{typeof(Plots._update_subplot_args),Plots.Plot{Plots.PlotlyBackend},Plots.Subplot{Plots.PlotlyBackend},Dict{Symbol,Any},Int64,Bool})
Base.precompile(Tuple{typeof(Plots.build_layout),Plots.GridLayout,Int64})
Base.precompile(Tuple{typeof(Plots.convert_to_polar),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1},Tuple{Int64,Float64}})
Base.precompile(Tuple{typeof(Plots.create_grid),Expr})
Base.precompile(Tuple{typeof(Plots.error_coords),Array{Float64,1},Array{Float64,1},Array{Float64,1},Vararg{Array{Float64,1},N} where N})
Base.precompile(Tuple{typeof(Plots.error_coords),Array{Float64,1},Array{Float64,1},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots.error_zipit),Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1}}})
Base.precompile(Tuple{typeof(Plots.fakedata),Int64,Vararg{Int64,N} where N})
Base.precompile(Tuple{typeof(Plots.get_clims),Plots.Subplot{Plots.GRBackend},Plots.Series,Function})
Base.precompile(Tuple{typeof(Plots.get_minor_ticks),Plots.Subplot{Plots.GRBackend},Plots.Axis,Tuple{Array{Float64,1},Array{String,1}}})
@@ -187,7 +205,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots.get_series_color),Array{Symbol,1},Plots.Subplot{Plots.GRBackend},Int64,Symbol})
Base.precompile(Tuple{typeof(Plots.get_series_color),Array{Symbol,1},Plots.Subplot{Plots.PlotlyBackend},Int64,Symbol})
Base.precompile(Tuple{typeof(Plots.get_xy),Array{OHLC,1}})
Base.precompile(Tuple{typeof(Plots.get_xy),OHLC{Float64},Int64,Float64})
Base.precompile(Tuple{typeof(Plots.gr_add_legend),Plots.Subplot{Plots.GRBackend},NamedTuple{(:w, :h, :dy, :leftw, :textw, :rightw, :xoffset, :yoffset, :width_factor),NTuple{9,Float64}},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots.gr_add_legend),Plots.Subplot{Plots.GRBackend},NamedTuple{(:w, :h, :dy, :leftw, :textw, :rightw, :xoffset, :yoffset, :width_factor),Tuple{Int64,Float64,Float64,Float64,Int64,Float64,Float64,Float64,Float64}},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots.gr_display),Plots.Subplot{Plots.GRBackend},Measures.Length{:mm,Float64},Measures.Length{:mm,Float64},Array{Float64,1}})
@@ -196,11 +213,13 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots.gr_draw_grid),Plots.Subplot{Plots.GRBackend},Plots.Axis,Segments{Tuple{Float64,Float64}}})
Base.precompile(Tuple{typeof(Plots.gr_draw_heatmap),Plots.Series,Array{Float64,1},Array{Float64,1},Array{Float64,2},Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_heatmap),Plots.Series,Base.OneTo{Int64},Base.OneTo{Int64},Array{Float64,2},Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_marker),Plots.Series,Int64,Float64,Tuple{Float64,Float64},Int64,Int64,Int64,Symbol})
Base.precompile(Tuple{typeof(Plots.gr_draw_markers),Plots.Series,Array{Int64,1},Array{Float64,1},Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_markers),Plots.Series,Base.OneTo{Int64},Array{Float64,1},Tuple{Float64,Float64},Int64,Int64})
Base.precompile(Tuple{typeof(Plots.gr_draw_markers),Plots.Series,Base.OneTo{Int64},Array{Float64,1},Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_markers),Plots.Series,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1},Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_segments),Plots.Series,Array{Float64,1},Array{Float64,1},Int64,Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_segments),Plots.Series,Array{Float64,1},Array{Float64,1},Nothing,Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_segments),Plots.Series,Base.OneTo{Int64},Array{Float64,1},Nothing,Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_draw_segments),Plots.Series,StepRange{Int64,Int64},Array{Float64,1},Int64,Tuple{Float64,Float64}})
Base.precompile(Tuple{typeof(Plots.gr_get_ticks_size),Tuple{Array{Float64,1},Array{Any,1}},Int64})
Base.precompile(Tuple{typeof(Plots.gr_get_ticks_size),Tuple{Array{Float64,1},Array{String,1}},Int64})
@@ -208,16 +227,16 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots.gr_label_ticks),Plots.Subplot{Plots.GRBackend},Symbol,Tuple{Array{Float64,1},Array{String,1}}})
Base.precompile(Tuple{typeof(Plots.gr_label_ticks_3d),Plots.Subplot{Plots.GRBackend},Symbol,Tuple{Array{Float64,1},Array{String,1}}})
Base.precompile(Tuple{typeof(Plots.gr_polaraxes),Int64,Float64,Plots.Subplot{Plots.GRBackend}})
Base.precompile(Tuple{typeof(Plots.gr_polyline3d),Array{Float64,1},Array{Float64,1},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots.gr_set_gradient),PlotUtils.ContinuousColorGradient})
Base.precompile(Tuple{typeof(Plots.heatmap_edges),Array{Float64,1},Symbol})
Base.precompile(Tuple{typeof(Plots.heatmap_edges),Base.OneTo{Int64},Symbol})
Base.precompile(Tuple{typeof(Plots.heatmap_edges),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Symbol})
Base.precompile(Tuple{typeof(Plots.heatmap_edges),UnitRange{Int64},Symbol})
Base.precompile(Tuple{typeof(Plots.ignorenan_minimum),Array{Int64,1}})
Base.precompile(Tuple{typeof(Plots.layout_args),Int64})
Base.precompile(Tuple{typeof(Plots.make_fillrange_side),UnitRange{Int64},LinRange{Float64}})
Base.precompile(Tuple{typeof(Plots.optimal_ticks_and_labels),Plots.Subplot{Plots.GRBackend},Plots.Axis,StepRange{Int64,Int64}})
Base.precompile(Tuple{typeof(Plots.optimal_ticks_and_labels),Plots.Subplot{Plots.GRBackend},Plots.Axis,UnitRange{Int64}})
Base.precompile(Tuple{typeof(Plots.processGridArg!),Dict{Symbol,Any},Bool,Symbol})
Base.precompile(Tuple{typeof(Plots.processGridArg!),Dict{Symbol,Any},Symbol,Symbol})
Base.precompile(Tuple{typeof(Plots.processGridArg!),RecipesPipeline.DefaultsDict,Bool,Symbol})
Base.precompile(Tuple{typeof(Plots.processLineArg),Dict{Symbol,Any},Array{Symbol,2}})
@@ -228,14 +247,18 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots.processMarkerArg),Dict{Symbol,Any},Shape})
Base.precompile(Tuple{typeof(Plots.processMarkerArg),Dict{Symbol,Any},Symbol})
Base.precompile(Tuple{typeof(Plots.process_annotation),Plots.Subplot{Plots.GRBackend},Int64,Float64,Plots.PlotText})
Base.precompile(Tuple{typeof(Plots.process_annotation),Plots.Subplot{Plots.PlotlyBackend},Int64,Float64,Plots.PlotText})
Base.precompile(Tuple{typeof(Plots.process_axis_arg!),Dict{Symbol,Any},StepRange{Int64,Int64},Symbol})
Base.precompile(Tuple{typeof(Plots.process_axis_arg!),Dict{Symbol,Any},Symbol,Symbol})
Base.precompile(Tuple{typeof(Plots.process_axis_arg!),Dict{Symbol,Any},Tuple{Int64,Int64},Symbol})
Base.precompile(Tuple{typeof(Plots.quiver_using_arrows),RecipesPipeline.DefaultsDict})
Base.precompile(Tuple{typeof(Plots.quiver_using_hack),RecipesPipeline.DefaultsDict})
Base.precompile(Tuple{typeof(Plots.reset_axis_defaults_byletter!)})
Base.precompile(Tuple{typeof(Plots.slice_arg),Array{Measures.Length{:mm,Float64},2},Int64})
Base.precompile(Tuple{typeof(Plots.slice_arg),Array{PlotUtils.ContinuousColorGradient,2},Int64})
Base.precompile(Tuple{typeof(Plots.slice_arg),Array{RGBA{Float64},2},Int64})
Base.precompile(Tuple{typeof(Plots.slice_arg),Array{String,2},Int64})
Base.precompile(Tuple{typeof(Plots.slice_arg),Array{Symbol,2},Int64})
Base.precompile(Tuple{typeof(Plots.slice_arg),Base.ReshapedArray{Int64,2,UnitRange{Int64},Tuple{}},Int64})
Base.precompile(Tuple{typeof(Plots.straightline_data),Tuple{Float64,Float64},Tuple{Float64,Float64},Array{Float64,1},Array{Float64,1},Int64})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},AbstractArray{OHLC,1}})
@@ -244,7 +267,9 @@ function _precompile_()
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:barhist}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:bar}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:histogram2d}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:hline}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:pie}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:quiver}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:spy}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:sticks}},Any,Any,Any})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{Val{:xerror}},Any,Any,Any})
@@ -268,19 +293,22 @@ function _precompile_()
Base.precompile(Tuple{typeof(bbox),Float64,Float64,Float64,Float64})
Base.precompile(Tuple{typeof(bbox),Measures.Length{:mm,Float64},Measures.Length{:mm,Float64},Measures.Length{:mm,Float64},Measures.Length{:mm,Float64}})
Base.precompile(Tuple{typeof(contour),Any,Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_linestyle),Tuple{Array{Any,1}}}})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}},typeof(Plots.gr_color),Tuple{Array{RGBA{Float64},2}}}})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(string),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(typeof),Tuple{Tuple{Plots.PortfolioComposition}}}}}})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(string),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(typeof),Tuple{Tuple{Plots.Spy}}}}}})
Base.precompile(Tuple{typeof(font),String,Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(iter_segments),Array{Float64,1},Array{Float64,1},UnitRange{Int64}})
Base.precompile(Tuple{typeof(iterate),Base.Iterators.Enumerate{Plots.SegmentsIterator},Tuple{Int64}})
Base.precompile(Tuple{typeof(merge),NamedTuple{(:annotation,),Tuple{Array{Tuple{Int64,Float64,Plots.PlotText},1}}},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}})
Base.precompile(Tuple{typeof(merge),NamedTuple{(:zcolor, :m, :ms, :lab),Tuple{Array{Float64,1},Tuple{Symbol,Float64,Plots.Stroke},Array{Float64,1},String}},NamedTuple{(:seriestype,),Tuple{Symbol}}})
Base.precompile(Tuple{typeof(plot!),Any})
Base.precompile(Tuple{typeof(plot),Any,Any})
Base.precompile(Tuple{typeof(plot),Any})
Base.precompile(Tuple{typeof(push!),Plots.Plot{Plots.GRBackend},Float64,Array{Float64,1}})
Base.precompile(Tuple{typeof(push!),Segments{Tuple{Float64,Float64,Float64}},Tuple{Float64,Int64,Int64},Tuple{Float64,Float64,Int64}})
Base.precompile(Tuple{typeof(setindex!),Dict{Plots.Subplot,Any},Dict{Symbol,Any},Plots.Subplot{Plots.PlotlyBackend}})
Base.precompile(Tuple{typeof(setindex!),Dict{Symbol,Any},Tuple{Int64,Float64,Symbol,Plots.Stroke},Symbol})
Base.precompile(Tuple{typeof(setindex!),Dict{Symbol,Any},Tuple{Symbol,Float64,Plots.Stroke},Symbol})
Base.precompile(Tuple{typeof(setindex!),Plots.Plot{Plots.GRBackend},RGBA{Float64},Symbol})
Base.precompile(Tuple{typeof(spy),Any})
Base.precompile(Tuple{typeof(stroke),Int64,Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(text),String,Int64,Symbol,Vararg{Symbol,N} where N})
+1 -1
View File
@@ -98,7 +98,7 @@ function buildanimation(anim::Animation, fn::AbstractString,
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -i "$(animdir)/palette.bmp" -lavfi "paletteuse=dither=sierra2_4a" -loop $loop -y $fn`)
end
else
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -loop $loop -y $fn`)
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -vf format=yuv420p -loop $loop -y $fn`)
end
show_msg && @info("Saved animation to ", fn)
+6
View File
@@ -94,6 +94,12 @@ function attr!(axis::Axis, args...; kw...)
for vi in v
discrete_value!(axis, vi)
end
#could perhaps use TimeType here, as Date and DateTime are both subtypes of TimeType
# or could perhaps check if dateformatter or datetimeformatter is in use
elseif k == :lims && isa(v, Tuple{Date,Date})
plotattributes[k] = (v[1].instant.periods.value, v[2].instant.periods.value)
elseif k == :lims && isa(v, Tuple{DateTime,DateTime})
plotattributes[k] = (v[1].instant.periods.value, v[2].instant.periods.value)
else
plotattributes[k] = v
end
+2 -2
View File
@@ -219,7 +219,7 @@ gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s))
function gr_inqtext(x, y, s::AbstractString)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.inqmathtex(x, y, s[2:end-1])
elseif findfirst(isequal('\\'), s) !== nothing || occursin("10^{", s)
elseif occursin('\\', s) || occursin("10^{", s)
GR.inqtextext(x, y, s)
else
GR.inqtext(x, y, s)
@@ -231,7 +231,7 @@ gr_text(x, y, s) = gr_text(x, y, string(s))
function gr_text(x, y, s::AbstractString)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.mathtex(x, y, s[2:end-1])
elseif findfirst(isequal('\\'), s) !== nothing || occursin("10^{", s)
elseif occursin('\\', s) || occursin("10^{", s)
GR.textext(x, y, s)
else
GR.text(x, y, s)
+78 -78
View File
@@ -46,7 +46,7 @@ import Dates
#Plots.jl imports HDF5 to main:
import ..HDF5
import ..HDF5: HDF5Group, HDF5Dataset
import ..HDF5: Group, Dataset
import ..Colors, ..Colorant
import ..PlotUtils.ColorSchemes.ColorScheme
@@ -159,40 +159,40 @@ _type_for_map(::Type{T}) where T<:Surface = Surface
#==Read/write things like type name in attributes
===============================================================================#
function _write_datatype_attr(ds::Union{HDF5Group, HDF5Dataset}, ::Type{T}) where T
function _write_datatype_attr(ds::Union{Group, Dataset}, ::Type{T}) where T
typestr = HDF5PLOT_MAP_TELEM2STR[T]
HDF5.attrs(ds)["TYPE"] = typestr
HDF5.attributes(ds)["TYPE"] = typestr
end
function _read_datatype_attr(ds::Union{HDF5Group, HDF5Dataset})
if !HDF5.exists(HDF5.attrs(ds), "TYPE")
function _read_datatype_attr(ds::Union{Group, Dataset})
if !Base.haskey(HDF5.attributes(ds), "TYPE")
return HDF5_AutoDetect
end
typestr = HDF5.read(HDF5.attrs(ds)["TYPE"])
typestr = HDF5.read(HDF5.attributes(ds)["TYPE"])
return HDF5PLOT_MAP_STR2TELEM[typestr]
end
#Type parameter attributes:
function _write_typeparam_attr(ds::HDF5Dataset, v::Length{T}) where T
HDF5.attrs(ds)["TYPEPARAM"] = string(T) #Need to add units for Length
function _write_typeparam_attr(ds::Dataset, v::Length{T}) where T
HDF5.attributes(ds)["TYPEPARAM"] = string(T) #Need to add units for Length
end
_read_typeparam_attr(ds::HDF5Dataset) = HDF5.read(HDF5.attrs(ds)["TYPEPARAM"])
_read_typeparam_attr(ds::Dataset) = HDF5.read(HDF5.attributes(ds)["TYPEPARAM"])
function _write_length_attr(grp::HDF5Group, v::Vector) #of a vector
HDF5.attrs(grp)["LENGTH"] = length(v)
function _write_length_attr(grp::Group, v::Vector) #of a vector
HDF5.attributes(grp)["LENGTH"] = length(v)
end
_read_length_attr(::Type{Vector}, grp::HDF5Group) = HDF5.read(HDF5.attrs(grp)["LENGTH"])
_read_length_attr(::Type{Vector}, grp::Group) = HDF5.read(HDF5.attributes(grp)["LENGTH"])
function _write_size_attr(grp::HDF5Group, v::Array) #of an array
HDF5.attrs(grp)["SIZE"] = [size(v)...]
function _write_size_attr(grp::Group, v::Array) #of an array
HDF5.attributes(grp)["SIZE"] = [size(v)...]
end
_read_size_attr(::Type{Array}, grp::HDF5Group) = tuple(HDF5.read(HDF5.attrs(grp)["SIZE"])...)
_read_size_attr(::Type{Array}, grp::Group) = tuple(HDF5.read(HDF5.attributes(grp)["SIZE"])...)
#==_write_typed(): Simple (leaf) datatypes. (Labels with type name.)
===============================================================================#
#= No: write out struct instead!
function _write_typed(grp::HDF5Group, name::String, v::T) where T
function _write_typed(grp::Group, name::String, v::T) where T
tstr = string(T)
path = HDF5.name(grp) * "/" * name
@info("Type not supported: $tstr\npath: $path")
@@ -200,41 +200,41 @@ function _write_typed(grp::HDF5Group, name::String, v::T) where T
end
=#
#Default behaviour: Assumes value is supported by HDF5 format
function _write_typed(grp::HDF5Group, name::String, v::HDF5_SupportedTypes)
function _write_typed(grp::Group, name::String, v::HDF5_SupportedTypes)
grp[name] = v
return #No need to _write_datatype_attr
end
function _write_typed(grp::HDF5Group, name::String, v::Nothing)
function _write_typed(grp::Group, name::String, v::Nothing)
grp[name] = "nothing" #Redundancy check/easier to read HDF5 file
_write_datatype_attr(grp[name], Nothing)
end
function _write_typed(grp::HDF5Group, name::String, v::Symbol)
function _write_typed(grp::Group, name::String, v::Symbol)
grp[name] = String(v)
_write_datatype_attr(grp[name], Symbol)
end
function _write_typed(grp::HDF5Group, name::String, v::Colorant)
function _write_typed(grp::Group, name::String, v::Colorant)
vstr = "#" * Colors.hex(v, :RRGGBBAA)
grp[name] = vstr
_write_datatype_attr(grp[name], Colorant)
end
function _write_typed(grp::HDF5Group, name::String, v::Extrema)
function _write_typed(grp::Group, name::String, v::Extrema)
grp[name] = [v.emin, v.emax] #More compact than writing struct
_write_datatype_attr(grp[name], Extrema)
end
function _write_typed(grp::HDF5Group, name::String, v::Length)
function _write_typed(grp::Group, name::String, v::Length)
grp[name] = v.value
_write_datatype_attr(grp[name], Length)
_write_typeparam_attr(grp[name], v)
end
function _write_typed(grp::HDF5Group, name::String, v::typeof(datetimeformatter))
function _write_typed(grp::Group, name::String, v::typeof(datetimeformatter))
grp[name] = string(v) #Just write something that helps reader
_write_datatype_attr(grp[name], typeof(datetimeformatter))
end
function _write_typed(grp::HDF5Group, name::String, v::Array{T}) where T<:Number #Default for arrays
function _write_typed(grp::Group, name::String, v::Array{T}) where T<:Number #Default for arrays
grp[name] = v
return #No need to _write_datatype_attr
end
function _write_typed(grp::HDF5Group, name::String, v::AbstractRange)
function _write_typed(grp::Group, name::String, v::AbstractRange)
_write_typed(grp, name, collect(v)) #For now
end
@@ -244,8 +244,8 @@ end
===============================================================================#
#Write an array using HDF5 hierarchy (when not using simple numeric eltype):
function _write_harray(grp::HDF5Group, name::String, v::Array)
sgrp = HDF5.g_create(grp, name)
function _write_harray(grp::Group, name::String, v::Array)
sgrp = HDF5.create_group(grp, name)
sz = size(v)
lidx = LinearIndices(sz)
@@ -260,8 +260,8 @@ function _write_harray(grp::HDF5Group, name::String, v::Array)
end
#Write Dict without tagging with type:
function _write(grp::HDF5Group, name::String, d::AbstractDict)
sgrp = HDF5.g_create(grp, name)
function _write(grp::Group, name::String, d::AbstractDict)
sgrp = HDF5.create_group(grp, name)
for (k, v) in d
kstr = string(k)
_write_typed(sgrp, kstr, v)
@@ -270,7 +270,7 @@ function _write(grp::HDF5Group, name::String, d::AbstractDict)
end
#Write out arbitrary `struct`s:
function _writestructgeneric(grp::HDF5Group, obj::T) where T
function _writestructgeneric(grp::Group, obj::T) where T
for fname in fieldnames(T)
v = getfield(obj, fname)
_write_typed(grp, String(fname), v)
@@ -283,7 +283,7 @@ end
===============================================================================#
#Catch-all (default behaviour for `struct`s):
function _write_typed(grp::HDF5Group, name::String, v::T) where T
function _write_typed(grp::Group, name::String, v::T) where T
#NOTE: need "name" parameter so that call signature is same with built-ins
MT = _type_for_map(T)
try #Check to see if type is supported
@@ -294,27 +294,27 @@ function _write_typed(grp::HDF5Group, name::String, v::T) where T
end
#If attribute is supported and no writer is defined, then this should work:
objgrp = HDF5.g_create(grp, name)
objgrp = HDF5.create_group(grp, name)
_write_datatype_attr(objgrp, MT)
_writestructgeneric(objgrp, v)
end
function _write_typed(grp::HDF5Group, name::String, v::Array{T}) where T
function _write_typed(grp::Group, name::String, v::Array{T}) where T
_write_harray(grp, name, v)
_write_datatype_attr(grp[name], Array) #{Any}
end
function _write_typed(grp::HDF5Group, name::String, v::Tuple, ::Type{ELT}) where ELT<: Number #Basic Tuple
function _write_typed(grp::Group, name::String, v::Tuple, ::Type{ELT}) where ELT<: Number #Basic Tuple
_write_typed(grp, name, [v...])
_write_datatype_attr(grp[name], Tuple)
end
function _write_typed(grp::HDF5Group, name::String, v::Tuple, ::Type) #CplxTuple
function _write_typed(grp::Group, name::String, v::Tuple, ::Type) #CplxTuple
_write_harray(grp, name, [v...])
_write_datatype_attr(grp[name], CplxTuple)
end
_write_typed(grp::HDF5Group, name::String, v::Tuple) = _write_typed(grp, name, v, eltype(v))
_write_typed(grp::Group, name::String, v::Tuple) = _write_typed(grp, name, v, eltype(v))
function _write_typed(grp::HDF5Group, name::String, v::Dict)
function _write_typed(grp::Group, name::String, v::Dict)
#=
tstr = string(Dict)
path = HDF5.name(grp) * "/" * name
@@ -323,27 +323,27 @@ function _write_typed(grp::HDF5Group, name::String, v::Dict)
=#
#No support for structures with Dicts yet
end
function _write_typed(grp::HDF5Group, name::String, d::DefaultsDict) #Typically for plot attributes
function _write_typed(grp::Group, name::String, d::DefaultsDict) #Typically for plot attributes
_write(grp, name, d)
_write_datatype_attr(grp[name], DefaultsDict)
end
function _write_typed(grp::HDF5Group, name::String, v::Axis)
sgrp = HDF5.g_create(grp, name)
function _write_typed(grp::Group, name::String, v::Axis)
sgrp = HDF5.create_group(grp, name)
#Ignore: sps::Vector{Subplot}
_write_typed(sgrp, "plotattributes", v.plotattributes)
_write_datatype_attr(sgrp, Axis)
end
function _write_typed(grp::HDF5Group, name::String, v::Subplot)
function _write_typed(grp::Group, name::String, v::Subplot)
#Not for use in main "Plot.subplots[]" hierarchy. Just establishes reference with subplot_index.
sgrp = HDF5.g_create(grp, name)
sgrp = HDF5.create_group(grp, name)
_write_typed(sgrp, "index", v[:subplot_index])
_write_datatype_attr(sgrp, Subplot)
return
end
function _write_typed(grp::HDF5Group, name::String, v::Plot)
function _write_typed(grp::Group, name::String, v::Plot)
#Don't write plot references
end
@@ -352,10 +352,10 @@ end
NOTE: No need to write out type information (inferred from hierarchy)
===============================================================================#
function _write(grp::HDF5Group, sp::Subplot{HDF5Backend})
function _write(grp::Group, sp::Subplot{HDF5Backend})
_write_typed(grp, "attr", sp.attr)
listgrp = HDF5.g_create(grp, "series_list")
listgrp = HDF5.create_group(grp, "series_list")
_write_length_attr(listgrp, sp.series_list)
for (i, series) in enumerate(sp.series_list)
#Just write .plotattributes part:
@@ -365,13 +365,13 @@ function _write(grp::HDF5Group, sp::Subplot{HDF5Backend})
return
end
function _write(grp::HDF5Group, plt::Plot{HDF5Backend})
function _write(grp::Group, plt::Plot{HDF5Backend})
_write_typed(grp, "attr", plt.attr)
listgrp = HDF5.g_create(grp, "subplots")
listgrp = HDF5.create_group(grp, "subplots")
_write_length_attr(listgrp, plt.subplots)
for (i, sp) in enumerate(plt.subplots)
sgrp = HDF5.g_create(listgrp, "$i")
sgrp = HDF5.create_group(listgrp, "$i")
_write(sgrp, sp)
end
@@ -380,8 +380,8 @@ end
function hdf5plot_write(plt::Plot{HDF5Backend}, path::AbstractString; name::String="_unnamed")
HDF5.h5open(path, "w") do file
HDF5.d_write(file, "VERSION_INFO", _get_Plots_versionstr())
grp = HDF5.g_create(file, h5plotpath(name))
HDF5.write_dataset(file, "VERSION_INFO", _get_Plots_versionstr())
grp = HDF5.create_group(file, h5plotpath(name))
_write(grp, plt)
end
end
@@ -391,45 +391,45 @@ end
===============================================================================#
#Types with built-in HDF5 support:
_read(::Type{HDF5_AutoDetect}, ds::HDF5Dataset) = HDF5.read(ds)
_read(::Type{HDF5_AutoDetect}, ds::Dataset) = HDF5.read(ds)
function _read(::Type{Nothing}, ds::HDF5Dataset)
function _read(::Type{Nothing}, ds::Dataset)
nstr = "nothing"
v = HDF5.read(ds)
if nstr != v
path = HDF5.name(ds)
throw(Meta.ParseError("_read(::Nothing, ::HDF5Group): Read $v != $nstr:\n$path"))
throw(Meta.ParseError("_read(::Nothing, ::Group): Read $v != $nstr:\n$path"))
end
return nothing
end
_read(::Type{Symbol}, ds::HDF5Dataset) = Symbol(HDF5.read(ds))
_read(::Type{Colorant}, ds::HDF5Dataset) = parse(Colorant, HDF5.read(ds))
_read(::Type{Tuple}, ds::HDF5Dataset) = tuple(HDF5.read(ds)...)
function _read(::Type{Extrema}, ds::HDF5Dataset)
_read(::Type{Symbol}, ds::Dataset) = Symbol(HDF5.read(ds))
_read(::Type{Colorant}, ds::Dataset) = parse(Colorant, HDF5.read(ds))
_read(::Type{Tuple}, ds::Dataset) = tuple(HDF5.read(ds)...)
function _read(::Type{Extrema}, ds::Dataset)
v = HDF5.read(ds)
return Extrema(v[1], v[2])
end
function _read(::Type{Length}, ds::HDF5Dataset)
function _read(::Type{Length}, ds::Dataset)
TUNIT = Symbol(_read_typeparam_attr(ds))
v = HDF5.read(ds)
T = typeof(v)
return Length{TUNIT,T}(v)
end
_read(::Type{typeof(datetimeformatter)}, ds::HDF5Dataset) = datetimeformatter
_read(::Type{typeof(datetimeformatter)}, ds::Dataset) = datetimeformatter
#== Helper functions for reading in complex data structures
===============================================================================#
#When type is unknown, _read_typed() figures it out:
function _read_typed(grp::HDF5Group, name::String)
function _read_typed(grp::Group, name::String)
ds = grp[name]
t = _read_datatype_attr(ds)
return _read(t, ds)
end
#_readstructgeneric: Needs object values to be written out with _write_typed():
function _readstructgeneric(::Type{T}, grp::HDF5Group) where T
function _readstructgeneric(::Type{T}, grp::Group) where T
vlist = Array{Any}(nothing, fieldcount(T))
for (i, fname) in enumerate(fieldnames(T))
vlist[i] = _read_typed(grp, String(fname))
@@ -438,7 +438,7 @@ function _readstructgeneric(::Type{T}, grp::HDF5Group) where T
end
#Read KW from group:
function _read(::Type{KW}, grp::HDF5Group)
function _read(::Type{KW}, grp::Group)
d = KW()
gnames = names(grp)
for k in gnames
@@ -459,9 +459,9 @@ end
===============================================================================#
#Catch-all (default behaviour for `struct`s):
_read(T::Type, grp::HDF5Group) = _readstructgeneric(T, grp)
_read(T::Type, grp::Group) = _readstructgeneric(T, grp)
function _read(::Type{Array}, grp::HDF5Group) #Array{Any}
function _read(::Type{Array}, grp::Group) #Array{Any}
sz = _read_size_attr(Array, grp)
if tuple(0) == sz; return []; end
result = Array{Any}(undef, sz)
@@ -479,9 +479,9 @@ function _read(::Type{Array}, grp::HDF5Group) #Array{Any}
return reshape(result, sz)
end
_read(::Type{CplxTuple}, grp::HDF5Group) = tuple(_read(Array, grp)...)
_read(::Type{CplxTuple}, grp::Group) = tuple(_read(Array, grp)...)
function _read(::Type{GridLayout}, grp::HDF5Group)
function _read(::Type{GridLayout}, grp::Group)
#parent = _read_typed(grp, "parent") #Can't use generic reader
parent = RootLayout() #TODO: support parent???
minpad = _read_typed(grp, "minpad")
@@ -494,17 +494,17 @@ function _read(::Type{GridLayout}, grp::HDF5Group)
return GridLayout(parent, minpad, bbox, grid, widths, heights, attr)
end
#Defaults depends on context. So: user must constructs with defaults, then read.
function _read(::Type{DefaultsDict}, grp::HDF5Group)
function _read(::Type{DefaultsDict}, grp::Group)
#User should set DefaultsDict.defaults to one of:
# _plot_defaults, _subplot_defaults, _axis_defaults, _series_defaults
path = HDF5.name(ds)
@warn("Cannot yet read DefaultsDict using _read_typed():\n $path\nCannot fully reconstruct plot.")
end
function _read(::Type{Axis}, grp::HDF5Group)
function _read(::Type{Axis}, grp::Group)
#1st arg appears to be ref to subplots. Seems to work without it.
return Axis([], DefaultsDict(_read(KW, grp["plotattributes"]), _axis_defaults))
end
function _read(::Type{Subplot}, grp::HDF5Group)
function _read(::Type{Subplot}, grp::Group)
#Not for use in main "Plot.subplots[]" hierarchy. Just establishes reference with subplot_index.
idx = _read_typed(grp, "index")
return HDF5PLOT_PLOTREF.ref.subplots[idx]
@@ -514,12 +514,12 @@ end
#== _read(): Main plot structures
===============================================================================#
function _read(grp::HDF5Group, sp::Subplot)
listgrp = HDF5.g_open(grp, "series_list")
function _read(grp::Group, sp::Subplot)
listgrp = HDF5.open_group(grp, "series_list")
nseries = _read_length_attr(Vector, listgrp)
for i in 1:nseries
sgrp = HDF5.g_open(listgrp, "$i")
sgrp = HDF5.open_group(listgrp, "$i")
seriesinfo = _read(KW, sgrp)
plot!(sp, seriesinfo[:x], seriesinfo[:y]) #Add data & create data structures
@@ -527,25 +527,25 @@ function _read(grp::HDF5Group, sp::Subplot)
end
#Perform after adding series... otherwise values get overwritten:
agrp = HDF5.g_open(grp, "attr")
agrp = HDF5.open_group(grp, "attr")
_hdf5_merge!(sp.attr, _read(KW, agrp))
return sp
end
function _read_plot(grp::HDF5Group)
listgrp = HDF5.g_open(grp, "subplots")
function _read_plot(grp::Group)
listgrp = HDF5.open_group(grp, "subplots")
n = _read_length_attr(Vector, listgrp)
#Construct new plot, +allocate subplots:
plt = plot(layout=n)
HDF5PLOT_PLOTREF.ref = plt #Used when reading "layout"
agrp = HDF5.g_open(grp, "attr")
agrp = HDF5.open_group(grp, "attr")
_hdf5_merge!(plt.attr, _read(KW, agrp))
for (i, sp) in enumerate(plt.subplots)
sgrp = HDF5.g_open(listgrp, "$i")
sgrp = HDF5.open_group(listgrp, "$i")
_read(sgrp, sp)
end
@@ -554,7 +554,7 @@ end
function hdf5plot_read(path::AbstractString; name::String="_unnamed")
HDF5.h5open(path, "r") do file
grp = HDF5.g_open(file, h5plotpath("_unnamed"))
grp = HDF5.open_group(file, h5plotpath("_unnamed"))
return _read_plot(grp)
end
end
+2 -1
View File
@@ -163,11 +163,12 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
) => nothing,
"fill" => cstr,
"fill opacity" => a,
"text opacity" => alpha(plot_color(sp[:legendfontcolor])),
"text opacity" => alpha(plot_color(sp[:legendfontcolor])),
"font" => pgfx_font(
sp[:legendfontsize],
pgfx_thickness_scaling(sp),
),
"text" => plot_color(sp[:legendfontcolor]),
),
"axis background/.style" => PGFPlotsX.Options(
"fill" => bgc_inside,
+3
View File
@@ -799,6 +799,9 @@ function py_set_scale(ax, sp::Subplot, axis::Axis)
letter = axis[:letter]
scale in supported_scales() || return @warn("Unhandled scale value in pyplot: $scale")
func = getproperty(ax, Symbol("set_", letter, "scale"))
if PyPlot.version v"3.3" # https://matplotlib.org/3.3.0/api/api_changes.html
letter = Symbol("")
end
kw = KW()
arg = if scale == :identity
"linear"
+1 -1
View File
@@ -54,9 +54,9 @@ function _ijulia_display_dict(plt::Plot)
elseif output_type == :html
mime = "text/html"
out[mime] = sprint(show, MIME(mime), plt)
_ijulia__extra_mime_info!(plt, out)
else
error("Unsupported output type $output_type")
end
_ijulia__extra_mime_info!(plt, out)
out
end
+20 -10
View File
@@ -8,25 +8,35 @@ ismultiversion = true
@static if !should_precompile
# nothing
elseif !ismultios && !ismultiversion
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
_precompile_()
@static if (isfile("../deps/SnoopCompile/precompile/precompile_Plots.jl"))
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
_precompile_()
end
else
@static if Sys.islinux()
@static if v"1.5.0-DEV" <= VERSION <= v"1.5.9"
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
@static if (isfile("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl"))
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
end
else
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
@static if (isfile("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl"))
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
end
end
else
@static if v"1.5.0-DEV" <= VERSION <= v"1.5.9"
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
@static if (isfile("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl"))
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
end
else
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
@static if (isfile("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl"))
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_Plots.jl")
_precompile_()
end
end
end
+6 -6
View File
@@ -268,15 +268,15 @@ end
end
end
newx, newy = zeros(3n), zeros(3n)
newz = z!== nothing ? zeros(3n) : nothing
for i = 1:n
newz = z !== nothing ? zeros(3n) : nothing
for (i, (xi, yi, zi)) = enumerate(zip(x, y, z !== nothing ? z : 1:n))
rng = (3i - 2):(3i)
newx[rng] = [x[i], x[i], NaN]
newx[rng] = [xi, xi, NaN]
if z !== nothing
newy[rng] = [y[i], y[i], NaN]
newz[rng] = [_cycle(fr, i), z[i], NaN]
newy[rng] = [yi, yi, NaN]
newz[rng] = [_cycle(fr, i), zi, NaN]
else
newy[rng] = [_cycle(fr, i), y[i], NaN]
newy[rng] = [_cycle(fr, i), yi, NaN]
end
end
x := newx
+4 -4
View File
@@ -420,13 +420,13 @@ xlabel!(s::AbstractString; kw...) = plot!(; xlabel = s, kw...)
ylabel!(s::AbstractString; kw...) = plot!(; ylabel = s, kw...)
"Set xlims for an existing plot"
xlims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; xlims = lims, kw...)
xlims!(lims::Tuple; kw...) = plot!(; xlims = lims, kw...)
"Set ylims for an existing plot"
ylims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; ylims = lims, kw...)
ylims!(lims::Tuple; kw...) = plot!(; ylims = lims, kw...)
"Set zlims for an existing plot"
zlims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; zlims = lims, kw...)
zlims!(lims::Tuple; kw...) = plot!(; zlims = lims, kw...)
xlims!(xmin::Real, xmax::Real; kw...) = plot!(; xlims = (xmin,xmax), kw...)
ylims!(ymin::Real, ymax::Real; kw...) = plot!(; ylims = (ymin,ymax), kw...)
@@ -478,4 +478,4 @@ yaxis!(args...; kw...) = plot!(; yaxis = args
xgrid!(args...; kw...) = plot!(; xgrid = args, kw...)
ygrid!(args...; kw...) = plot!(; ygrid = args, kw...)
@specialize
@specialize
+44
View File
@@ -13,4 +13,48 @@ using Plots, Test, Dates
ref_xlims = (x[1].instant.periods.value, x[end].instant.periods.value)
@test Plots.ylims(p) == ref_ylims
@test Plots.xlims(p) == ref_xlims
#@static if (haskey(ENV, "APPVEYOR") || haskey(ENV, "CI"))
@static if haskey(ENV, "APPVEYOR")
@info "Skipping display tests on AppVeyor"
else
@test isa(display(p), Nothing) == true
closeall()
end
end # testset
@testset "Date xlims" begin
y=[1.0*i*i for i in 1:10]
x=[Date(2019,11,i) for i in 1:10]
span = (Date(2019,10,31), Date(2019,11,11))
ref_xlims = map(date->date.instant.periods.value, span)
p = plot(x,y, xlims=span, widen = false)
@test Plots.xlims(p) == ref_xlims
#@static if (haskey(ENV, "APPVEYOR") || haskey(ENV, "CI"))
@static if haskey(ENV, "APPVEYOR")
@info "Skipping display tests on AppVeyor"
else
@test isa(display(p), Nothing) == true
closeall()
end
end # testset
@testset "DateTime xlims" begin
y=[1.0*i*i for i in 1:10]
x=[DateTime(2019,11,i,11) for i in 1:10]
span = (DateTime(2019,10,31,11,59,59), DateTime(2019,11,11,12,01,15))
ref_xlims = map(date->date.instant.periods.value, span)
p = plot(x,y, xlims=span, widen = false)
@test Plots.xlims(p) == ref_xlims
#@static if (haskey(ENV, "APPVEYOR") || haskey(ENV, "CI"))
@static if haskey(ENV, "APPVEYOR")
@info "Skipping display tests on AppVeyor"
else
@test isa(display(p), Nothing) == true
closeall()
end
end # testset
+4 -2
View File
@@ -31,10 +31,12 @@ end # testset
include("test_defaults.jl")
include("test_axes.jl")
include("test_axis_letter.jl")
include("test_components.jl")
include("test_shorthands.jl")
include("integration_dates.jl")
include("test_recipes.jl")
include("test_hdf5plots.jl")
include("test_pgfplotsx.jl")
include("integration_dates.jl")
reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...)
@@ -131,7 +133,7 @@ const IMG_TOL = VERSION < v"1.4" && Sys.iswindows() ? 1e-1 : is_ci() ? 1e-2 : 1e
@test isa(p, Plots.Plot) == true
@test isa(display(p), Nothing) == true
p = plot([Dates.Date(2019, 1, 1), Dates.Date(2019, 2, 1)], [3, 4])
annotate!(p, [(Dates.Date(2019, 1, 15), 3.2, Plots.text("Test", :red, :center))])
annotate!(p, [(Dates.Date(2019, 1, 15), 3.2, :auto)])
hline!(p, [3.1])
@test isa(p, Plots.Plot) == true
@test isa(display(p), Nothing) == true
+111
View File
@@ -0,0 +1,111 @@
using Plots, Test
@testset "Shapes" begin
@testset "Copy" begin
square = Shape([(0,0),(1,0),(1,1),(0,1)])
square2 = Shape(square)
@test square2.x == square.x
@test square2.y == square.y
end
@testset "Center" begin
square = Shape([(0,0),(1,0),(1,1),(0,1)])
@test Plots.center(square) == (0.5,0.5)
end
@testset "Translate" begin
square = Shape([(0,0),(1,0),(1,1),(0,1)])
squareUp = Shape([(0,1),(1,1),(1,2),(0,2)])
squareUpRight = Shape([(1,1),(2,1),(2,2),(1,2)])
@test Plots.translate(square,0,1).x == squareUp.x
@test Plots.translate(square,0,1).y == squareUp.y
@test Plots.center(translate!(square,1)) == (1.5,1.5)
end
@testset "Rotate" begin
# 2 radians rotation matrix
R2 = [cos(2) sin(2); -sin(2) cos(2)]
coords = [0 0; 1 0; 1 1; 0 1]'
coordsRotated2 = R2*(coords.-0.5).+0.5
square = Shape([(0,0),(1,0),(1,1),(0,1)])
# make a new, rotated square
square2 = Plots.rotate(square, -2)
@test square2.x coordsRotated2[1,:]
@test square2.y coordsRotated2[2,:]
# unrotate the new square in place
rotate!(square2, 2)
@test square2.x coords[1,:]
@test square2.y coords[2,:]
end
end
@testset "Brush" begin
@testset "Colors" begin
baseline = brush(1, RGB(0,0,0))
@test brush(:black) == baseline
@test brush("black") == baseline
end
@testset "Weight" begin
@test brush(10).size == 10
@test brush(0.1).size == 1
end
@testset "Alpha" begin
@test brush(0.4).alpha == 0.4
@test brush(20).alpha == nothing
end
@testset "Bad Argument" begin
# using test_logs because test_warn seems to not work anymore
@test_logs (:warn,"Unused brush arg: nothing (Nothing)") begin
brush(nothing)
end
end
end
@testset "Fonts" begin
@testset "Scaling" begin
sizesToCheck = [:titlefontsize, :legendfontsize, :legendtitlefontsize,
:xtickfontsize, :ytickfontsize, :ztickfontsize,
:xguidefontsize, :yguidefontsize, :zguidefontsize,]
# get inital font sizes
initialSizes = [Plots.default(s) for s in sizesToCheck ]
#scale up font sizes
scalefontsizes(2)
# get inital font sizes
doubledSizes = [Plots.default(s) for s in sizesToCheck ]
@test doubledSizes == initialSizes*2
# reset font sizes
resetfontsizes()
finalSizes = [Plots.default(s) for s in sizesToCheck ]
@test finalSizes == initialSizes
end
end
@testset "Series Annotations" begin
square = Shape([(0,0),(1,0),(1,1),(0,1)])
@test_logs (:warn,"Unused SeriesAnnotations arg: triangle (Symbol)") begin
p = plot([1,2,3],
series_annotations=(["a"],
2, # pass a scale factor
(1,4), # pass two scale factors (overwrites first one)
square, # pass a shape
font(:courier), # pass an annotation font
:triangle # pass an incorrect argument
))
sa = p.series_list[1].plotattributes[:series_annotations]
@test sa.strs == ["a"]
@test sa.font.family == "courier"
@test sa.baseshape == square
@test sa.scalefactor == (1,4)
end
end
+8
View File
@@ -1,4 +1,6 @@
using Plots, Test
using OffsetArrays
@testset "lens!" begin
pl = plot(1:5)
lens!(pl, [1,2], [1,2], inset = (1, bbox(0.0,0.0,0.2,0.2)), colorbar = false)
@@ -23,3 +25,9 @@ end # testset
vsp = vspan([1,3], ylims=(-2,5), widen = false)
@test Plots.ylims(vsp) == (-2,5)
end # testset
@testset "offset axes" begin
tri = OffsetVector(vcat(1:5, 4:-1:1), 11:19)
sticks = plot(tri, seriestype = :sticks)
@test length(sticks) == 1
end
+48
View File
@@ -0,0 +1,48 @@
using Plots, Test
@testset "Shorthands" begin
@testset "Set Lims" begin
p = plot(rand(10))
xlims!((1,20))
@test xlims(p) == (1,20)
ylims!((-1,1))
@test ylims(p) == (-1,1)
zlims!((-1,1))
@test zlims(p) == (-1,1)
xlims!(-1,11)
@test xlims(p) == (-1,11)
ylims!((-10,10))
@test ylims(p) == (-10,10)
zlims!((-10,10))
@test zlims(p) == (-10,10)
end
@testset "Set Ticks" begin
p = plot([0,2,3,4,5,6,7,8,9,10])
xticks = 2:6
xticks!(xticks)
@test Plots.get_subplot(current(),1).attr[:xaxis][:ticks] == xticks
yticks = 0.2:0.1:0.7
yticks!(yticks)
@test Plots.get_subplot(current(),1).attr[:yaxis][:ticks] == yticks
xticks = [5,6,7.5]
xlabels = ["a","b","c"]
xticks!(xticks, xlabels)
@test Plots.get_subplot(current(),1).attr[:xaxis][:ticks] == (xticks, xlabels)
yticks = [.5,.6,.75]
ylabels = ["z","y","x"]
yticks!(yticks, ylabels)
@test Plots.get_subplot(current(),1).attr[:yaxis][:ticks] == (yticks, ylabels)
end
end