diff --git a/src/pipeline.jl b/src/pipeline.jl index 46c8c7f5..7874543d 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -266,7 +266,7 @@ function _subplot_setup(plt::Plot, plotattributes::AKW, kw_list::Vector{KW}) sp_attrs[sp] = attr end - _add_plot_title!(plt, plotattributes) + _add_plot_title!(plt) # override subplot/axis args. `sp_attrs` take precendence for (idx, sp) in enumerate(plt.subplots) attr = if !haskey(plotattributes, :subplot) || plotattributes[:subplot] == idx @@ -287,8 +287,9 @@ function series_idx(kw_list::AVec{KW}, kw::AKW) Int(kw[:series_plotindex]) - Int(kw_list[1][:series_plotindex]) + 1 end -function _add_plot_title!(plt, plotattributes) +function _add_plot_title!(plt) plot_title = plt[:plot_title] + plot_titleindex = nothing if plot_title != "" # make new subplot for plot title @@ -308,9 +309,6 @@ function _add_plot_title!(plt, plotattributes) plt[:plot_titleindex] = subplot[:subplot_index] subplot[:framestyle] = :none subplot[:margin] = 0px - # prevents propagation (see JuliaPlots/Plots.jl/issues/4083) - pop!(plotattributes, :framestyle, nothing) - pop!(plotattributes, :margin, nothing) push!(plt.subplots, subplot) end @@ -322,7 +320,7 @@ function _add_plot_title!(plt, plotattributes) end end - return nothing + return plot_titleindex end ## Series recipes diff --git a/src/plot.jl b/src/plot.jl index e527e54c..3fa4d044 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -163,11 +163,11 @@ function plot!(plt1::Plot, plt2::Plot, plts_tail::Plot...; kw...) cmdidx += 1 end end - _add_plot_title!(plt, plotattributes) + ttl_idx = _add_plot_title!(plt) # first apply any args for the subplots for (idx, sp) in enumerate(plt.subplots) - _update_subplot_args(plt, sp, plotattributes, idx, false) + _update_subplot_args(plt, sp, idx == ttl_idx ? KW() : plotattributes, idx, false) end # finish up diff --git a/test/runtests.jl b/test/runtests.jl index 66885cff..a52631ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,19 +37,25 @@ end Plots.use_local_dependencies[] = temp end -include("test_defaults.jl") -include("test_pipeline.jl") -include("test_axes.jl") -include("test_layouts.jl") -include("test_contours.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("test_plotly.jl") +for fn in ( + "test_defaults.jl" + "test_pipeline.jl" + "test_axes.jl" + "test_layouts.jl" + "test_contours.jl" + "test_axis_letter.jl" + "test_components.jl" + "test_shorthands.jl" + "integration_dates.jl" + "test_recipes.jl" + "test_hdf5plots.jl" + "test_pgfplotsx.jl" + "test_plotly.jl" +) + @testset "$fn" begin + include(fn) + end +end reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...)