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.jl

30 lines
766 B
Julia
Raw Normal View History

2022-04-05 01:25:01 +00:00
using ColorSchemes
function angle_color(φ::Float64, color_scheme::ColorSchemes.ColorScheme)
return get(color_scheme, rem2pi(φ, RoundDown) / (2 * π))
end
function gen_axis_and_colorbar(
fig, sim_consts::ReCo.SimConsts; axis_title::AbstractString=""
)
ax = Axis(
fig[1, 1];
limits=(
-sim_consts.half_box_len,
sim_consts.half_box_len,
-sim_consts.half_box_len,
sim_consts.half_box_len,
),
aspect=AxisAspect(1),
xlabel=L"x",
ylabel=L"y",
title=axis_title,
)
color_scheme = ColorSchemes.cyclic_mrybm_35_75_c68_n256_s25
Colorbar(fig[1, 2]; limits=(0, 2), colormap=color_scheme, label=L"\varphi / \pi")
return (ax, color_scheme)
end