Merge pull request #2940 from daschw/marker-segments

Fix marker shapes with segments
This commit is contained in:
Daniel Schwabeneder 2020-08-31 20:57:38 +02:00 committed by GitHub
commit b7fedc42d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 621 additions and 713 deletions

View File

@ -1,7 +1,7 @@
name = "Plots"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
author = ["Tom Breloff (@tbreloff)"]
version = "1.6.1"
version = "1.6.2"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

File diff suppressed because it is too large Load Diff

View File

@ -92,19 +92,15 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.mesh3d)),NamedTuple{(:connections,),Tuple{Tuple{Array{Int64,1},Array{Int64,1},Array{Int64,1}}}},typeof(mesh3d),Array{Int64,1},Vararg{Array{Int64,1},N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.pie)),NamedTuple{(:title, :l),Tuple{String,Float64}},typeof(pie),Array{String,1},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{(:alpha, :seriestype),Tuple{Float64,Symbol}},typeof(plot!),Plots.Plot{Plots.PlotlyBackend},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{(: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})
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.PlotlyBackend},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},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!),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:markersize, :c, :seriestype),Tuple{Int64,Symbol,Symbol}},typeof(plot!),Array{Float64,1}})
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!),Array{Int64,1},Array{Float64,1}})
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{(:seriestype,),Tuple{Symbol}},typeof(plot!),Plots.Plot{Plots.PlotlyBackend},Array{Int64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:title,),Tuple{String}},typeof(plot!),Plots.Plot{Plots.GRBackend}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot!)),NamedTuple{(:title,),Tuple{String}},typeof(plot!),Plots.Plot{Plots.PlotlyBackend}})
@ -155,6 +151,7 @@ function _precompile_()
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}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:seriestype,),Tuple{Symbol}},typeof(plot),Array{Dates.DateTime,1},UnitRange{Int64},Vararg{Any,N} where N})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:title, :l, :seriestype),Tuple{String,Float64,Symbol}},typeof(plot),Array{String,1},Array{Float64,1}})
Base.precompile(Tuple{Core.kwftype(typeof(Plots.plot)),NamedTuple{(:title,),Tuple{Array{String,2}}},typeof(plot),Plots.Plot{Plots.GRBackend},Plots.Plot{Plots.GRBackend}})
@ -175,6 +172,7 @@ function _precompile_()
Base.precompile(Tuple{Core.kwftype(typeof(Plots.test_examples)),NamedTuple{(:skip,),Tuple{Array{Int64,1}}},typeof(test_examples),Symbol})
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{PlotUtils.ContinuousColorGradient,1},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_linecolor),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.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}}}}})
@ -196,16 +194,14 @@ function _precompile_()
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._heatmap_edges),Array{Float64,1},Bool})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Array{Float64,1},1},Array{Array{Float64,1},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Dates.DateTime,1},UnitRange{Int64},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Float64,1},Array{Float64,1},UnitRange{Int64}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Function,1},Float64,Float64}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Int64,1},Array{Float64,1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{String,1},Array{Float64,1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{String,1},Array{String,1},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{Array{Tuple{Int64,Int64},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.GRBackend},Dict{Symbol,Any},Tuple{StepRange{Int64,Int64},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{AbstractArray{Float64,1},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{Array{Float64,1},1},Array{Array{Float64,1},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{Array{T,1} where T,1},Array{Float64,2}}})
@ -220,7 +216,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{OHLC,1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{String,1},Array{Float64,1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{String,1},Array{String,1},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{Tuple{Int64,Int64},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{Tuple{Int64,Real},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Array{Union{Missing, Int64},1}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{Plots.PortfolioComposition}})
@ -230,7 +225,9 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{StepRange{Int64,Int64},Array{Float64,2}}})
Base.precompile(Tuple{typeof(Plots._plot!),Plots.Plot{Plots.PlotlyBackend},Dict{Symbol,Any},Tuple{UnitRange{Int64}}})
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_plot_args),Plots.Plot{Plots.PlotlyBackend},RecipesPipeline.DefaultsDict})
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_periphery),Plots.Subplot{Plots.GRBackend},Array{Any,1}})
Base.precompile(Tuple{typeof(Plots._update_subplot_periphery),Plots.Subplot{Plots.PlotlyBackend},Array{Any,1}})
@ -244,6 +241,8 @@ function _precompile_()
Base.precompile(Tuple{typeof(Plots.get_minor_ticks),Plots.Subplot{Plots.GRBackend},Plots.Axis,Tuple{Array{Float64,1},Array{Any,1}}})
Base.precompile(Tuple{typeof(Plots.get_minor_ticks),Plots.Subplot{Plots.GRBackend},Plots.Axis,Tuple{Array{Float64,1},Array{String,1}}})
Base.precompile(Tuple{typeof(Plots.get_minor_ticks),Plots.Subplot{Plots.GRBackend},Plots.Axis,Tuple{Array{Int64,1},Array{String,1}}})
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),OHLC{Float64},Int64,Float64})
Base.precompile(Tuple{typeof(Plots.gr_display),Plots.Subplot{Plots.GRBackend},Measures.Length{:mm,Float64},Measures.Length{:mm,Float64},Array{Float64,1}})
Base.precompile(Tuple{typeof(Plots.gr_draw_colorbar),Plots.GRColorbar,Plots.Subplot{Plots.GRBackend},Tuple{Float64,Float64},Array{Float64,1}})
@ -270,9 +269,9 @@ function _precompile_()
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.processFontArg!),Dict{Symbol,Any},Symbol,Int64})
Base.precompile(Tuple{typeof(Plots.processFontArg!),Dict{Symbol,Any},Symbol,String})
Base.precompile(Tuple{typeof(Plots.processFontArg!),Dict{Symbol,Any},Symbol,Symbol})
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}})
@ -302,8 +301,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),Dict{Symbol,Any},Array{GeometryBasics.Point{2,Float64},1}})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),Dict{Symbol,Any},Array{OHLC,1}})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),Dict{Symbol,Any},Plots.PortfolioComposition})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),Dict{Symbol,Any},Type{Val{:contour}},Plots.Plot{Plots.GRBackend}})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),Dict{Symbol,Any},Type{Val{:spy}},Plots.Plot{Plots.GRBackend}})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:barbins}},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:barhist}},Base.OneTo{Int64},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:bar}},Array{Float64,1},Array{Float64,1},Nothing})
@ -314,7 +311,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:hline}},Base.OneTo{Int64},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:line}},Base.OneTo{Int64},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:pie}},Array{String,1},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:steppost}},Array{Float64,1},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:steppre}},Array{Float64,1},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:steppre}},Array{Int64,1},Array{Float64,1},Nothing})
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),RecipesPipeline.DefaultsDict,Type{Val{:steppre}},Base.OneTo{Int64},Array{Float64,1},Nothing})
@ -326,7 +322,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(RecipesPipeline.preprocess_attributes!),Plots.Plot{Plots.GRBackend},RecipesPipeline.DefaultsDict})
Base.precompile(Tuple{typeof(RecipesPipeline.process_userrecipe!),Plots.Plot{Plots.GRBackend},Array{Dict{Symbol,Any},1},Dict{Symbol,Any}})
Base.precompile(Tuple{typeof(RecipesPipeline.process_userrecipe!),Plots.Plot{Plots.PlotlyBackend},Array{Dict{Symbol,Any},1},Dict{Symbol,Any}})
Base.precompile(Tuple{typeof(RecipesPipeline.splittable_attribute),Plots.Plot{Plots.GRBackend},Symbol,Array{String,1},Int64})
Base.precompile(Tuple{typeof(RecipesPipeline.warn_on_recipe_aliases!),Plots.Plot{Plots.GRBackend},Array{RecipeData,1},Symbol,Array{AbstractArray{Float64,1},1}})
Base.precompile(Tuple{typeof(RecipesPipeline.warn_on_recipe_aliases!),Plots.Plot{Plots.GRBackend},Array{RecipeData,1},Symbol,Array{Array{T,1} where T,1}})
Base.precompile(Tuple{typeof(RecipesPipeline.warn_on_recipe_aliases!),Plots.Plot{Plots.GRBackend},Array{RecipeData,1},Symbol,Array{Complex{Float64},1}})
@ -449,7 +444,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(backend),Plots.PlotlyBackend})
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),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_colorgradient),Tuple{Array{Any,1}}}})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_fillalpha),Tuple{Array{Any,1}}}})
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Plots.get_linealpha),Tuple{Array{Any,1}}}})
@ -460,7 +454,8 @@ function _precompile_()
Base.precompile(Tuple{typeof(deepcopy),Plots.Plot{Plots.PlotlyBackend}})
Base.precompile(Tuple{typeof(font),String,Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(heatmap),Array{Dates.DateTime,1},Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(iter_segments),Array{Float64,1},Array{Float64,1},Vararg{Any,N} where N})
Base.precompile(Tuple{typeof(iter_segments),Array{Float64,1},Array{Float64,1},UnitRange{Int64}})
Base.precompile(Tuple{typeof(iter_segments),Array{Float64,1}})
Base.precompile(Tuple{typeof(iter_segments),Base.OneTo{Int64},Array{Float64,1}})
Base.precompile(Tuple{typeof(ohlc),Array{OHLC,1}})
Base.precompile(Tuple{typeof(plot!),Array{Float64,2}})
@ -474,7 +469,6 @@ function _precompile_()
Base.precompile(Tuple{typeof(plot),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Function})
Base.precompile(Tuple{typeof(push!),Plots.Plot{Plots.GRBackend},Float64,Array{Float64,1}})
Base.precompile(Tuple{typeof(setindex!),Dict{Any,Plots.Subplot},Plots.Subplot{Plots.GRBackend},Symbol})
Base.precompile(Tuple{typeof(setindex!),Dict{Any,Plots.Subplot},Plots.Subplot{Plots.PlotlyBackend},Symbol})
Base.precompile(Tuple{typeof(setindex!),Dict{Plots.Subplot,Any},Dict{Symbol,Any},Plots.Subplot{Plots.GRBackend}})
Base.precompile(Tuple{typeof(setindex!),Dict{Plots.Subplot,Any},Dict{Symbol,Any},Plots.Subplot{Plots.PlotlyBackend}})
Base.precompile(Tuple{typeof(stroke),Int64,Vararg{Any,N} where N})

View File

@ -348,12 +348,15 @@ function gr_draw_markers(
shapes = series[:markershape]
if shapes != :none
for (i, rng) in enumerate(iter_segments(series))
ms = get_thickness_scaling(series) * _cycle(msize, i)
msw = get_thickness_scaling(series) * _cycle(strokewidth, i)
shape = _cycle(shapes, i)
for j in rng
gr_draw_marker(series, _cycle(x, j), _cycle(y, j), clims, i, ms, msw, shape)
for (i, rng) in enumerate(iter_segments(series, :scatter))
rng = intersect(eachindex(x), rng)
if !isempty(rng)
ms = get_thickness_scaling(series) * _cycle(msize, i)
msw = get_thickness_scaling(series) * _cycle(strokewidth, i)
shape = _cycle(shapes, i)
for j in rng
gr_draw_marker(series, _cycle(x, j), _cycle(y, j), clims, i, ms, msw, shape)
end
end
end
end
@ -1634,7 +1637,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
if st in (:path, :scatter, :straightline)
if x !== nothing && length(x) > 1
lz = series[:line_z]
segments = iter_segments(series)
segments = iter_segments(series, st)
# do area fill
if frng !== nothing
GR.setfillintstyle(GR.INTSTYLE_SOLID)
@ -1759,7 +1762,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
if st == :path3d
if length(x) > 1
lz = series[:line_z]
segments = iter_segments(series)
segments = iter_segments(series, st)
for (i, rng) in enumerate(segments)
lc = get_linecolor(series, clims, i)
gr_set_line(

View File

@ -299,13 +299,13 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
series[:z],
)...)
else
iter_segments(series)
iter_segments(series, st)
end
for (i, rng) in enumerate(segments)
segment_opt = PGFPlotsX.Options()
segment_opt = merge(segment_opt, pgfx_linestyle(opt, i))
if opt[:markershape] != :none
marker = opt[:markershape]
marker = _cycle(opt[:markershape], i)
if marker isa Shape
x = marker.x
y = marker.y

View File

@ -694,9 +694,11 @@ function plotly_series_segments(series::Series, plotattributes_base::KW, x, y, z
hasfillrange = st in (:path, :scatter, :scattergl, :straightline) &&
(isa(series[:fillrange], AbstractVector) || isa(series[:fillrange], Tuple))
segments = iter_segments(series)
segments = iter_segments(series, st)
plotattributes_outs = fill(KW(), (hasfillrange ? 2 : 1 ) * length(segments))
needs_scatter_fix = !isscatter && hasmarker && !any(isnan,y)
for (i,rng) in enumerate(segments)
plotattributes_out = deepcopy(plotattributes_base)
plotattributes_out[:showlegend] = i==1 ? should_add_to_legend(series) : false
@ -733,13 +735,15 @@ function plotly_series_segments(series::Series, plotattributes_base::KW, x, y, z
# add "marker"
if hasmarker
mcolor = rgba_string(plot_color(get_markercolor(series, clims, i), get_markeralpha(series, i)))
lcolor = rgba_string(plot_color(get_markerstrokecolor(series, i), get_markerstrokealpha(series, i)))
plotattributes_out[:marker] = KW(
:symbol => get_plotly_marker(_cycle(series[:markershape], i), string(_cycle(series[:markershape], i))),
# :opacity => series[:markeralpha],
# :opacity => needs_scatter_fix ? [1, 0] : 1,
:size => 2 * _cycle(series[:markersize], i),
:color => rgba_string(plot_color(get_markercolor(series, clims, i), get_markeralpha(series, i))),
:color => needs_scatter_fix ? [mcolor, "rgba(0, 0, 0, 0.000)"] : mcolor,
:line => KW(
:color => rgba_string(plot_color(get_markerstrokecolor(series, i), get_markerstrokealpha(series, i))),
:color => needs_scatter_fix ? [lcolor, "rgba(0, 0, 0, 0.000)"] : lcolor,
:width => _cycle(series[:markerstrokewidth], i),
),
)

View File

@ -398,7 +398,6 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
# line plot
if st in (:path, :path3d, :steppre, :steppost, :straightline)
if maximum(series[:linewidth]) > 0
segments = iter_segments(series)
# TODO: check LineCollection alternative for speed
# if length(segments) > 1 && (any(typeof(series[attr]) <: AbstractVector for attr in (:fillcolor, :fillalpha)) || series[:fill_z] !== nothing) && !(typeof(series[:linestyle]) <: AbstractVector)
# # multicolored line segments
@ -429,7 +428,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
# end
# push!(handles, handle)
# else
for (i, rng) in enumerate(iter_segments(series))
for (i, rng) in enumerate(iter_segments(series, st))
handle = ax."plot"((arg[rng] for arg in xyargs)...;
label = i == 1 ? series[:label] : "",
zorder = series[:series_plotindex],
@ -472,130 +471,24 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
end
# add markers?
if series[:markershape] != :none && st in (:path, :scatter, :path3d,
:scatter3d, :steppre, :steppost,
:bar)
markercolor = if any(typeof(series[arg]) <: AVec for arg in (:markercolor, :markeralpha)) || series[:marker_z] !== nothing
# py_color(plot_color.(get_markercolor.(series, clims, eachindex(x)), get_markeralpha.(series, eachindex(x))))
[py_color(plot_color(get_markercolor(series, clims, i), get_markeralpha(series, i))) for i in eachindex(x)]
else
py_color(plot_color(series[:markercolor], series[:markeralpha]))
end
extrakw[:c] = if markercolor isa Array
permutedims(hcat([[m...] for m in markercolor]...),[2,1])
elseif markercolor isa Tuple
reshape([markercolor...], 1, length(markercolor))
else
error("This case is not handled. Please file an issue.")
end
xyargs = if st == :bar && !isvertical(series)
(y, x)
else
xyargs
end
if isa(series[:markershape], AbstractVector{Shape})
# this section will create one scatter per data point to accommodate the
# vector of shapes
handle = []
x,y = xyargs
shapes = series[:markershape]
msc = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series))
lw = py_thickness_scale(plt, series[:markerstrokewidth])
for i=eachindex(y)
if series[:marker_z] !== nothing
extrakw[:c] = [py_color(get_markercolor(series, i), get_markercoloralpha(series, i))]
end
push!(handle, ax."scatter"(_cycle(x,i), _cycle(y,i);
label = series[:label],
zorder = series[:series_plotindex] + 0.5,
marker = py_marker(_cycle(shapes,i)),
s = py_thickness_scale(plt, _cycle(series[:markersize],i)).^ 2,
facecolors = py_color(get_markercolor(series, i), get_markercoloralpha(series, i)),
edgecolors = msc,
linewidths = lw,
extrakw...
))
end
push!(handles, handle)
elseif isa(series[:markershape], AbstractVector{Symbol})
handle = []
x,y = xyargs
shapes = series[:markershape]
prev_marker = py_marker(_cycle(shapes,1))
cur_x_list = []
cur_y_list = []
cur_color_list = []
cur_scale_list = []
delete!(extrakw, :c)
for i=eachindex(y)
cur_marker = py_marker(_cycle(shapes,i))
if ( cur_marker == prev_marker )
push!(cur_x_list, _cycle(x,i))
push!(cur_y_list, _cycle(y,i))
push!(cur_color_list, _cycle(markercolor, i))
push!(cur_scale_list, py_thickness_scale(plt, _cycle(series[:markersize],i)).^ 2)
continue
end
push!(handle, ax."scatter"(cur_x_list, cur_y_list;
label = series[:label],
zorder = series[:series_plotindex] + 0.5,
marker = prev_marker,
s = cur_scale_list,
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
facecolors = cur_color_list,
extrakw...
))
cur_x_list = [_cycle(x,i)]
cur_y_list = [_cycle(y,i)]
cur_color_list = [_cycle(markercolor, i)]
cur_scale_list = [py_thickness_scale(plt, _cycle(series[:markersize],i)) .^ 2]
prev_marker = cur_marker
end
if !isempty(cur_color_list)
push!(handle, ax."scatter"(cur_x_list, cur_y_list;
label = series[:label],
zorder = series[:series_plotindex] + 0.5,
marker = prev_marker,
s = cur_scale_list,
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
facecolors = cur_color_list,
extrakw...
))
end
push!(handles, handle)
else
# do a normal scatter plot
# Add depthshade option for 3d plots
if RecipesPipeline.is3d(sp)
extrakw[:depthshade] = get(series[:extra_kwargs], :depthshade, false)
if series[:markershape] != :none && st in (
:path, :scatter, :path3d, :scatter3d, :steppre, :steppost, :bar
)
for (i, rng) in enumerate(iter_segments(series, :scatter))
xyargs = if st == :bar && !isvertical(series)
y[rng], x[rng]
else
x[rng], y[rng]
end
handle = ax."scatter"(xyargs...;
label = series[:label],
zorder = series[:series_plotindex] + 0.5,
marker = py_marker(series[:markershape]),
s = py_thickness_scale(plt, series[:markersize]) .^2,
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
marker = py_marker(_cycle(series[:markershape], i)),
s = py_thickness_scale(plt, _cycle(series[:markersize], i)).^ 2,
facecolors = py_color(get_markercolor(series, i), get_markeralpha(series, i)),
edgecolors = py_color(get_markerstrokecolor(series, i), get_markerstrokealpha(series, i)),
linewidths = py_thickness_scale(plt, get_markerstrokewidth(series, i)),
extrakw...
)
push!(handles, handle)

View File

@ -1024,6 +1024,21 @@ const _examples = PlotExample[
),
],
),
PlotExample(
"Vectors of markershapes and segments",
"",
[quote
yv = ones(9)
ys = [1; 1; NaN; ones(6)]
plot(
5 .- [yv 2ys 3yv 4ys],
seriestype = [:path :path :scatter :scatter],
markershape = [:utriangle, :rect],
markersize = 8,
color = [:red, :black],
)
end]
),
]
# Some constants for PlotDocs and PlotReferenceImages

View File

@ -67,19 +67,17 @@ function iter_segments(args...)
SegmentsIterator(tup, n1, n2)
end
function iter_segments(series::Series)
function iter_segments(series::Series, seriestype::Symbol = :path)
x, y, z = series[:x], series[:y], series[:z]
if x === nothing
return UnitRange{Int}[]
elseif has_attribute_segments(series)
if series[:seriestype] in (:scatter, :scatter3d)
if any(isnan,y)
return [iter_segments(y)...]
elseif seriestype in (:scatter, :scatter3d)
return [[i] for i in eachindex(y)]
else
if any(isnan,y)
return [iter_segments(y)...]
else
return [i:(i + 1) for i in firstindex(y):lastindex(y)-1]
end
return [i:(i + 1) for i in firstindex(y):lastindex(y)-1]
end
else
segs = UnitRange{Int}[]
@ -617,6 +615,7 @@ function has_attribute_segments(series::Series)
:markerstrokecolor,
:markerstrokealpha,
:markerstrokewidth,
:markershape,
]
) || any(
typeof(series[attr]) <: AbstractArray for attr in (:line_z, :fill_z, :marker_z)