add magic arguments
This commit is contained in:
parent
0faf079114
commit
0858de0449
@ -482,7 +482,7 @@ const _subplot_args = sort(union(collect(keys(_subplot_defaults))))
|
|||||||
const _plot_args = sort(union(collect(keys(_plot_defaults))))
|
const _plot_args = sort(union(collect(keys(_plot_defaults))))
|
||||||
|
|
||||||
const _magic_axis_args = [:axis, :tickfont, :guidefont, :grid, :minorgrid]
|
const _magic_axis_args = [:axis, :tickfont, :guidefont, :grid, :minorgrid]
|
||||||
const _magic_subplot_args = [:titlefont, :legendfont, :legendtitlefont, ]
|
const _magic_subplot_args = [:titlefont, :legendfont, :legendtitlefont, :plot_titlefont, :colorbar_titlefont]
|
||||||
const _magic_series_args = [:line, :marker, :fill]
|
const _magic_series_args = [:line, :marker, :fill]
|
||||||
|
|
||||||
const _all_axis_args = sort(union([_axis_args; _magic_axis_args]))
|
const _all_axis_args = sort(union([_axis_args; _magic_axis_args]))
|
||||||
@ -1062,7 +1062,7 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# fonts
|
# fonts
|
||||||
for fontname in (:titlefont, :legendfont, :legendtitlefont)
|
for fontname in (:titlefont, :legendfont, :legendtitlefont, :plot_titlefont, :colorbar_titlefont)
|
||||||
args = RecipesPipeline.pop_kw!(plotattributes, fontname, ())
|
args = RecipesPipeline.pop_kw!(plotattributes, fontname, ())
|
||||||
for arg in wraptuple(args)
|
for arg in wraptuple(args)
|
||||||
processFontArg!(plotattributes, fontname, arg)
|
processFontArg!(plotattributes, fontname, arg)
|
||||||
|
|||||||
@ -359,11 +359,22 @@ end # testset
|
|||||||
end # testset
|
end # testset
|
||||||
|
|
||||||
@testset "Titlefonts" begin
|
@testset "Titlefonts" begin
|
||||||
pl = plot(1:5, title = ("Test me", 2, :left))
|
pl = plot(1:5, title = "Test me", titlefont = (2, :left))
|
||||||
|
@test pl[1][:title] == "Test me"
|
||||||
|
@test pl[1][:titlefontsize] == 2
|
||||||
|
@test pl[1][:titlefonthalign] == :left
|
||||||
Plots._update_plot_object(pl)
|
Plots._update_plot_object(pl)
|
||||||
ax_opt = Plots.pgfx_axes(pl.o)[1].options
|
ax_opt = Plots.pgfx_axes(pl.o)[1].options
|
||||||
@test ax_opt["title"] == "Test me"
|
@test ax_opt["title"] == "Test me"
|
||||||
if @test(haskey(ax_opt.dict, "title_style")) isa Test.Pass
|
if @test(haskey(ax_opt.dict, "title_style")) isa Test.Pass
|
||||||
@test ax_opt["title style"]["at"] == "{(0,1)}"
|
@test ax_opt["title style"]["at"] == "{(0,1)}"
|
||||||
end
|
end
|
||||||
|
pl = plot(1:5, plot_title = "Test me", plot_titlefont = (2, :left))
|
||||||
|
@test pl[:plot_title] == "Test me"
|
||||||
|
@test pl[:plot_titlefontsize] == 2
|
||||||
|
@test pl[:plot_titlefonthalign] == :left
|
||||||
|
pl = heatmap(rand(3,3), colorbar_title = "Test me", colorbar_titlefont = (12, :right))
|
||||||
|
@test pl[1][:colorbar_title] == "Test me"
|
||||||
|
@test pl[1][:colorbar_titlefontsize] == 12
|
||||||
|
@test pl[1][:colorbar_titlefonthalign] == :right
|
||||||
end # testset
|
end # testset
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user