Plots
We define methods for plots that are wrappers of methods of the Makie.jl package. Many methods have optionnal arguments (e.g. title, xlabel, xscale, ...) consistent with Makie.jl, so please refer to this well documented package for more informations. Wavkins plots allows one to plot standard quantities used in the theory (spectra of different quantities, associated fluxes, global quantities, etc.) quite simply.
If ones tries to plot a spectrum with negative or zero values in a log-log plot, Makie crashes WavKinS. In the next versions, the plotting routines will be decoupled form the main code and this issue will be solved.
Basics
WavKinS.plot_1D_base! — Methodplot_1D_base!(x, y; fig=nothing, ax=nothing, xlabel=L"$x$", ylabel=L"$y$", title="Title", xlims=nothing, ylims=nothing, xscale=log10, yscale=log10)Basic plot of y vs x.
fig: Figureax: Axis of the figure
You can overwrite on a plot by specifying fig and ax. Otherwise, it will create a new plot. Return fig and ax.
WavKinS.plot_2D_slices_base! — Methodplot_2D_slices_base!(x, y, Z; dir=1, nslices=8, fig=nothing, ax=nothing, cb=nothing, slabel=L"$s$", zlabel=L"$z$", clabel=L"$c$", title="Title", slims=nothing, zlims=nothing, clims=nothing, sscale=log10, zscale=log10, cscale=log10, colormap=:inferno)Plot nslices slices of Z in direction dir.
fig: Figureax: Axis of the figurecb: Colormap of the figure
You can overwrite on a plot by specifying fig, ax and cb. Otherwise, it will create a new plot. Return fig, ax and cb.
WavKinS.plot_heatmap_base! — Methodplot_heatmap_base!(x, y, Z; fig=nothing, ax=nothing, hm=nothing, xlabel=L"$x$", ylabel=L"$y$", title="Title", xlims=nothing, ylims=nothing, zlims=nothing, xscale=log10, yscale=log10, zscale=log10, colormap=:jet)Basic heatmap plot of Z vs x and y.
fig: Figureax: Axis of the figurehm: Colormap of the figure
You can overwrite on a plot by specifying fig, ax and hm. Otherwise, it will create a new plot. Return fig, ax and hm.
WavKinS.plot_surface_base! — Methodplot_surface_base!(x, y, Z; fig=nothing, ax=nothing, hm=nothing, xlabel=L"$x$", ylabel=L"$y$", zlabel=L"$z$", title="Title", xlims=nothing, ylims=nothing, zlims=nothing, xscale=log10, yscale=log10, zscale=log10, colormap=:jet)Basic surface plot of Z vs x and y.
fig: Figureax: Axis of the figurehm: Colormap of the figure
You can overwrite on a plot by specifying fig, ax and hm. Otherwise, it will create a new plot. Return fig, ax and hm.
WavKinS.plot_theo! — Methodplot_theo!(ax, kk::Vector{Float64}, nk::Vector{Float64}; color="red")Add the theoretical line nk vs kk on figure with axis ax.
Spectra
WavKinS.plot_1D_spectra_density! — Methodfunction plot_1D_spectra_density!(Run; ρ=one, fig=nothing, ax=nothing, ylabel=L"$q_k$", title="Quantity 1D spectra", xlims=nothing, ylims=nothing, xscale=log10, yscale=log10, xcomp = 0.)Plot $k$, $k_h$ and $k_z$ spectra of a quantity whose spectral density is ρ. See isotropic_density_spectrum!, kh_density_spectrum! and kz_density_spectrum!.
fig: Figureax: Axis of the figurexcomp: spectral slope compensation
You can overwrite on a plot by specifying fig and ax. Otherwise, it will create a new plot. Return fig and ax.
WavKinS.plot_2D_slices — Methodplot_2D_slices(Run; ρ=1, xlims=nothing, ylims=nothing, xscale=log10, yscale=log10, sthks=0:0.2:1)Plot slices of the spectrum of the quantity with spectral density ρ at constant angles sthks × π/2 with the vertical axis ${\bf e}_z$. Return the figure fig and its axis ax.
WavKinS.plot_2D_slices_khkz! — Methodplot_2D_slices_khkz!(Run; ρ=one, dir=1, nslices=8, fig=nothing, ax=nothing, cb=nothing, zlabel="", title=L"Spectrum slices", zlims=nothing, colormap=:inferno)Plot $k_h$ (dir=1) or $k_z$ (dir=2) slices of the spectrum of the quantity with spectral density ρ. See density_spectrum! and plot_2D_slices_base!.
WavKinS.plot_density! — Methodplot_density!(Run; ρ=one, fig=nothing, ax=nothing, hm=nothing, label=L"$q_k$", title="Quantity spectrum", xlims=nothing, ylims=nothing, zlims=nothing, xscale=log10, yscale=log10, zscale=log10, xcomp = 0.)Plot spectrum of a quantity whose spectral density is ρ. See density_spectrum!.
fig: Figureax: Axis of the figurehm: Colormap of the figurexcomp: spectral slope compensation
You can overwrite on a plot by specifying fig, ax and hm. Otherwise, it will create a new plot. Return fig, ax and hm.
WavKinS.plot_energy! — Methodfunction plot_energy!(Run; fig=nothing, ax=nothing, hm=nothing, xlims=nothing, ylims=nothing, zlims=nothing, xscale=log10, yscale=log10, zscale=log10, xcomp = 0.)Plot energy spectrum. It is plot_density! with ρ=ω.
WavKinS.plot_wave_action! — Methodfunction plot_wave_action!(Run; fig=nothing, ax=nothing, hm=nothing, xlims=nothing, ylims=nothing, zlims=nothing, xscale=log10, yscale=log10, zscale=log10, xcomp = 0.)Plot wave action spectrum. It is plot_density! with ρ=1.
Fluxes
WavKinS.plot_2D_flux — Methodplot_2D_flux(Nk::wave_spectrum_khkz, Fh::Matrix{Float64}, Fz::Matrix{Float64}; xlabel=L"$log_{10} k_h$", ylabel=L"$log_{10} k_z$", title="Fluxes")Plot fluxes for anisotropic systems.
Nk: structure containing the gridFh: flux in horizontal wave vectorsFz: flux in vertical wave vectors
WavKinS.plot_density_flux! — Methodplot_density_flux!(Run; ρ=one, fig=nothing, ax=nothing, label=L"$P_k$", title="Density flux", Disp = 1., xlims=nothing, ylims=nothing)Plot fluxes of a quantity whose spectral density is ρ. See density_flux! and plot_2D_flux.
fig: Figureax: Axis of the figure
You can overwrite on a plot by specifying fig and ax. Otherwise, it will create a new plot. Return fig and ax.
WavKinS.plot_density_flux_angular! — Methodplot_density_flux_angular!(Run; ρ=one, fig=nothing, ax=nothing, label=L"$P_k$", title="Angular quantity flux", Disp = 1., xlims=nothing, ylims=nothing, xscale=identity, yscale=identity)Plot the angular fluxes of a quantity whose spectral density is ρ. See density_flux_angular!.
fig: Figureax: Axis of the figure
You can overwrite on a plot by specifying fig and ax. Otherwise, it will create a new plot. Return fig and ax.
WavKinS.plot_density_flux_isotropic! — Methodplot_density_flux_isotropic!(Run; ρ=one, fig=nothing, ax=nothing, label=L"$P_k$", title="Isotropic quantity flux", Disp=1., xlims=nothing, ylims=nothing, xscale=log10, yscale=identity)Plot the isotropic (after sum over angle) fluxes of a quantity whose spectral density is ρ. Corresponds to the standard flux for isotropic systems. See density_flux_isotropic!.
fig: Figureax: Axis of the figure
You can overwrite on a plot by specifying fig and ax. Otherwise, it will create a new plot. Return fig and ax.
WavKinS.plot_energy_flux! — Methodplot_energy_flux!(Run; fig=nothing, ax=nothing, Disp = 1., xlims=nothing, ylims=nothing)Plot energy fluxes. It is plot_density_flux! with ρ=ω.
WavKinS.plot_energy_flux_angular! — Methodplot_energy_flux_angular!(Run; fig=nothing, ax=nothing, Disp = 1., xlims=nothing, ylims=nothing, xscale=identity, yscale=identity)Plot the angular fluxes of energy. It is plot_density_flux_angular! with ρ=ω.
WavKinS.plot_energy_flux_isotropic! — Methodplot_energy_flux_isotropic!(Run; fig=nothing, ax=nothing, Disp=1., xlims=nothing, ylims=nothing, xscale=log10, yscale=identity)Plot the isotropic (after sum over angle) energy fluxes. It is plot_density_flux_isotropic! with ρ=ω.
WavKinS.plot_wave_action_flux! — Methodplot_wave_action_flux!(Run; fig=nothing, ax=nothing, Disp = 1., xlims=nothing, ylims=nothing)Plot wave action fluxes. It is plot_density_flux! with ρ=1.
WavKinS.plot_wave_action_flux_angular! — Methodplot_wave_action_flux_angular!(Run; fig=nothing, ax=nothing, Disp = 1., xlims=nothing, ylims=nothing, xscale=identity, yscale=identity)Plot the angular fluxes of wave action. It is plot_density_flux_angular! with ρ=1.
WavKinS.plot_wave_action_flux_isotropic! — Methodplot_wave_action_flux_isotropic!(Run; fig=nothing, ax=nothing, Disp=1., xlims=nothing, ylims=nothing, xscale=log10, yscale=identity)Plot the isotropic (after sum over angle) wave action fluxes. It is plot_density_flux_isotropic! with ρ=1.