Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e0d02552f |
20
src/args.jl
20
src/args.jl
@ -259,6 +259,15 @@ const _subplot_defaults = KW(
|
|||||||
:bottom_margin => :match,
|
:bottom_margin => :match,
|
||||||
:subplot_index => -1,
|
:subplot_index => -1,
|
||||||
:colorbar_title => "",
|
:colorbar_title => "",
|
||||||
|
:fontfamily => "Helvetica",
|
||||||
|
:fontsize => 10,
|
||||||
|
:fontcolor => :match, # matches foreground_color
|
||||||
|
:titlefontfamily => :match,
|
||||||
|
:titlefontsize => :match,
|
||||||
|
:titlefontcolor => :match,
|
||||||
|
:legendfontfamily => :match,
|
||||||
|
:legendfontsize => :match,
|
||||||
|
:legendfontcolor => :match,
|
||||||
)
|
)
|
||||||
|
|
||||||
const _axis_defaults = KW(
|
const _axis_defaults = KW(
|
||||||
@ -278,6 +287,12 @@ const _axis_defaults = KW(
|
|||||||
:discrete_values => [],
|
:discrete_values => [],
|
||||||
:formatter => :auto,
|
:formatter => :auto,
|
||||||
:mirror => false,
|
:mirror => false,
|
||||||
|
:tickfontfamily => :match,
|
||||||
|
:tickfontsize => :match,
|
||||||
|
:tickfontcolor => :match,
|
||||||
|
:guidefontfamily => :match,
|
||||||
|
:guidefontsize => :match,
|
||||||
|
:guidefontcolor => :match,
|
||||||
)
|
)
|
||||||
|
|
||||||
const _suppress_warnings = Set{Symbol}([
|
const _suppress_warnings = Set{Symbol}([
|
||||||
@ -942,8 +957,13 @@ const _match_map2 = KW(
|
|||||||
:foreground_color_border => :foreground_color_subplot,
|
:foreground_color_border => :foreground_color_subplot,
|
||||||
:foreground_color_guide => :foreground_color_subplot,
|
:foreground_color_guide => :foreground_color_subplot,
|
||||||
:foreground_color_text => :foreground_color_subplot,
|
:foreground_color_text => :foreground_color_subplot,
|
||||||
|
:fontcolor => :foreground_color_subplot,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for prefix in (:title,:legend,:guide,:tick), postfix in (:family,:size,:color)
|
||||||
|
_match_map2[Symbol(prefix,:font,postfix)] = Symbol(:font,postfix)
|
||||||
|
end
|
||||||
|
|
||||||
# properly retrieve from plt.attr, passing `:match` to the correct key
|
# properly retrieve from plt.attr, passing `:match` to the correct key
|
||||||
function Base.getindex(plt::Plot, k::Symbol)
|
function Base.getindex(plt::Plot, k::Symbol)
|
||||||
v = plt.attr[k]
|
v = plt.attr[k]
|
||||||
|
|||||||
@ -48,8 +48,8 @@ _series_updated(plt::Plot, series::Series) = nothing
|
|||||||
|
|
||||||
_before_layout_calcs(plt::Plot) = nothing
|
_before_layout_calcs(plt::Plot) = nothing
|
||||||
|
|
||||||
title_padding(sp::Subplot) = sp[:title] == "" ? 0mm : sp[:titlefont].pointsize * pt
|
title_padding(sp::Subplot) = sp[:title] == "" ? 0mm : sp[:titlefontsize] * pt
|
||||||
guide_padding(axis::Axis) = axis[:guide] == "" ? 0mm : axis[:guidefont].pointsize * pt
|
guide_padding(axis::Axis) = axis[:guide] == "" ? 0mm : axis[:guidefontsize] * pt
|
||||||
|
|
||||||
"Returns the (width,height) of a text label."
|
"Returns the (width,height) of a text label."
|
||||||
function text_size(lablen::Int, sz::Number, rot::Number = 0)
|
function text_size(lablen::Int, sz::Number, rot::Number = 0)
|
||||||
@ -90,7 +90,7 @@ function tick_padding(axis::Axis)
|
|||||||
# hgt
|
# hgt
|
||||||
|
|
||||||
# get the height of the rotated label
|
# get the height of the rotated label
|
||||||
text_size(longest_label, axis[:tickfont].pointsize, rot)[2]
|
text_size(longest_label, axis[:tickfontsize], rot)[2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user