1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-11-08 22:21:08 +00:00
ReCo.jl/visualization/common_CairoMakie.jl

32 lines
599 B
Julia
Raw Normal View History

2022-04-05 01:25:01 +00:00
function init_cairomakie!()
CairoMakie.activate!()
set_theme!()
return nothing
end
function gen_figure(; padding=5)
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)
save("$parent_dir/$filename", fig; pt_per_unit=1)
return nothing
end