From 8cc276fc424e917ef9a033e32ca4a35e4c38636e Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 17 Jan 2020 12:32:55 +0100 Subject: [PATCH] add utility functions --- src/utils.jl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/utils.jl b/src/utils.jl index 0fd11167..b0116564 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -1004,6 +1004,33 @@ ignorenan_extrema(plt::Plot) = (xmin(plt), xmax(plt)) # --------------------------------------------------------------- # get fonts from objects: +plottitlefont(p::Plot) = font( + p[:plot_titlefontfamily], + p[:plot_titlefontsize], + p[:plot_titlefontvalign], + p[:plot_titlefonthalign], + p[:plot_titlefontrotation], + p[:plot_titlefontcolor], +) + +windowtitlefont(p::Plot) = font( + p[:window_titlefontfamily], + p[:window_titlefontsize], + p[:window_titlefontvalign], + p[:window_titlefonthalign], + p[:window_titlefontrotation], + p[:window_titlefontcolor], +) + +colorbartitlefont(sp::Subplot) = font( + sp[:colorbar_titlefontfamily], + sp[:colorbar_titlefontsize], + sp[:colorbar_titlefontvalign], + sp[:colorbar_titlefonthalign], + sp[:colorbar_titlefontrotation], + sp[:colorbar_titlefontcolor], +) + titlefont(sp::Subplot) = font( sp[:titlefontfamily], sp[:titlefontsize],