implement titlefont legendfont tickfont and guidefont functions to construct font objects from subplots and axes
This commit is contained in:
parent
68a060b7eb
commit
8fee5e0de7
@ -764,7 +764,7 @@ function processGridArg!(d::KW, arg, letter)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
processFontArgs!(d::KW, fontname::Symbol, args::Tuple)
|
function processFontArgs!(d::KW, fontname::Symbol, args::Tuple)
|
||||||
fnt = font(args...)
|
fnt = font(args...)
|
||||||
d[Symbol(fontname, :family)] = fnt.family
|
d[Symbol(fontname, :family)] = fnt.family
|
||||||
d[Symbol(fontname, :size)] = fnt.pointsize
|
d[Symbol(fontname, :size)] = fnt.pointsize
|
||||||
|
|||||||
40
src/utils.jl
40
src/utils.jl
@ -1007,3 +1007,43 @@ xmax(plt::Plot) = ignorenan_maximum([ignorenan_maximum(series.d[:x]) for series
|
|||||||
|
|
||||||
"Extrema of x-values in plot"
|
"Extrema of x-values in plot"
|
||||||
ignorenan_extrema(plt::Plot) = (xmin(plt), xmax(plt))
|
ignorenan_extrema(plt::Plot) = (xmin(plt), xmax(plt))
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# get fonts from objects:
|
||||||
|
|
||||||
|
titlefont(sp::Subplot) = font(
|
||||||
|
sp[:titlefontfamily],
|
||||||
|
sp[:titlefontsize],
|
||||||
|
sp[:titlefont],
|
||||||
|
sp[:titlefonthalign],
|
||||||
|
sp[:titlefontrotation],
|
||||||
|
sp[:titlefontcolor],
|
||||||
|
)
|
||||||
|
|
||||||
|
legendfont(sp::Subplot) = font(
|
||||||
|
sp[:legendfontfamily],
|
||||||
|
sp[:legendfontsize],
|
||||||
|
sp[:legendfont],
|
||||||
|
sp[:legendfonthalign],
|
||||||
|
sp[:legendfontrotation],
|
||||||
|
sp[:legendfontcolor],
|
||||||
|
)
|
||||||
|
|
||||||
|
tickfont(ax::Axis) = font(
|
||||||
|
ax[:tickfontfamily],
|
||||||
|
ax[:tickfontsize],
|
||||||
|
ax[:tickfont],
|
||||||
|
ax[:tickfonthalign],
|
||||||
|
ax[:tickfontrotation],
|
||||||
|
ax[:tickfontcolor],
|
||||||
|
)
|
||||||
|
|
||||||
|
guidefont(ax::Axis) = font(
|
||||||
|
ax[:guidefontfamily],
|
||||||
|
ax[:guidefontsize],
|
||||||
|
ax[:guidefont],
|
||||||
|
ax[:guidefonthalign],
|
||||||
|
ax[:guidefontrotation],
|
||||||
|
ax[:guidefontcolor],
|
||||||
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user