Compare commits
2 Commits
master
...
bbs/fix-di
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fc6246eb3 | ||
|
|
92bc1f3e95 |
12
src/plot.jl
12
src/plot.jl
@ -90,19 +90,20 @@ function plot(args...; kw...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# build a new plot from existing plots
|
# build a new plot from existing plots
|
||||||
# note: we split into plt1 and plts_tail so we can dispatch correctly
|
# note: we split into plt1, plt2 and plts_tail so we can dispatch correctly
|
||||||
plot(plt1::Plot, plts_tail::Plot...; kw...) = plot!(deepcopy(plt1), deepcopy.(plts_tail)...; kw...)
|
plot(plt1::Plot, plt2::Plot, plts_tail::Plot...; kw...) = plot!(deepcopy(plt1), deepcopy(plt2), deepcopy.(plts_tail)...; kw...)
|
||||||
function plot!(plt1::Plot, plts_tail::Plot...; kw...)
|
function plot!(plt1::Plot, plt2::Plot, plts_tail::Plot...; kw...)
|
||||||
@nospecialize
|
@nospecialize
|
||||||
plotattributes = KW(kw)
|
plotattributes = KW(kw)
|
||||||
RecipesPipeline.preprocess_attributes!(plotattributes)
|
RecipesPipeline.preprocess_attributes!(plotattributes)
|
||||||
|
|
||||||
# build our plot vector from the args
|
# build our plot vector from the args
|
||||||
n = length(plts_tail) + 1
|
n = length(plts_tail) + 2
|
||||||
plts = Array{Plot}(undef, n)
|
plts = Array{Plot}(undef, n)
|
||||||
plts[1] = plt1
|
plts[1] = plt1
|
||||||
|
plts[2] = plt2
|
||||||
for (i,plt) in enumerate(plts_tail)
|
for (i,plt) in enumerate(plts_tail)
|
||||||
plts[i+1] = plt
|
plts[i+2] = plt
|
||||||
end
|
end
|
||||||
|
|
||||||
# compute the layout
|
# compute the layout
|
||||||
@ -186,6 +187,7 @@ function plot!(args...; kw...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# this adds to a specific plot... most plot commands will flow through here
|
# this adds to a specific plot... most plot commands will flow through here
|
||||||
|
plot(plt::Plot, args...; kw...) = plot!(deepcopy(plt), args...; kw...)
|
||||||
function plot!(plt::Plot, args...; kw...)
|
function plot!(plt::Plot, args...; kw...)
|
||||||
@nospecialize
|
@nospecialize
|
||||||
plotattributes = KW(kw)
|
plotattributes = KW(kw)
|
||||||
|
|||||||
@ -30,6 +30,7 @@ end
|
|||||||
end # testset
|
end # testset
|
||||||
|
|
||||||
include("test_defaults.jl")
|
include("test_defaults.jl")
|
||||||
|
include("test_pipeline.jl")
|
||||||
include("test_axes.jl")
|
include("test_axes.jl")
|
||||||
include("test_axis_letter.jl")
|
include("test_axis_letter.jl")
|
||||||
include("test_components.jl")
|
include("test_components.jl")
|
||||||
|
|||||||
10
test/test_pipeline.jl
Normal file
10
test/test_pipeline.jl
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using Plots, Test
|
||||||
|
|
||||||
|
@testset "plot" begin
|
||||||
|
pl = plot(1:5)
|
||||||
|
pl2 = plot(pl, tex_output_standalone = true)
|
||||||
|
@test pl[:tex_output_standalone] == false
|
||||||
|
@test pl2[:tex_output_standalone] == true
|
||||||
|
plot!(pl, tex_output_standalone = true)
|
||||||
|
@test pl[:tex_output_standalone] == true
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user