mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-11-08 22:21:08 +00:00
29 lines
585 B
Julia
29 lines
585 B
Julia
|
function init_cairomakie!()
|
||
|
CairoMakie.activate!()
|
||
|
set_theme!()
|
||
|
|
||
|
return nothing
|
||
|
end
|
||
|
|
||
|
function gen_figure(; padding=4)
|
||
|
text_width_in_pt = 405
|
||
|
|
||
|
return Figure(;
|
||
|
resolution=(text_width_in_pt, 0.55 * text_width_in_pt),
|
||
|
fontsize=10,
|
||
|
figure_padding=padding,
|
||
|
)
|
||
|
end
|
||
|
|
||
|
function set_gaps!(fig::Figure)
|
||
|
colgap!(fig.layout, 5)
|
||
|
rowgap!(fig.layout, 5)
|
||
|
|
||
|
return nothing
|
||
|
end
|
||
|
|
||
|
function save_fig(filename::String, fig::Figure, parent_dir="exports/graphics")
|
||
|
mkpath(parent_dir)
|
||
|
|
||
|
return save("$parent_dir/$filename", fig; pt_per_unit=1)
|
||
|
end
|