Plotting.jl

Luna.Plotting.cmap_coloursFunction
cmap_colours(num, cmap="viridis"; cmin=0, cmax=0.8)

Make an array of num different colours that follow the colourmap cmap between the values cmin and cmax.

source
Luna.Plotting.cmap_whiteMethod
cmap_white(cmap, N=512, n=8)

Replace the lowest colour stop of cmap (after splitting into n stops) with white and create a new colourmap with N stops.

source
Luna.Plotting.cornertextMethod
cornertext(ax, text;
           corner="ul", pad=0.02, xpad=nothing, ypad=nothing, kwargs...)

Place a text in the axes ax in the corner defined by corner. Padding can be defined for x and y together via pad or separately via xpad and ypad. Further keyword arguments are passed to plt.text.

Possible values for corner are ul, ur, ll, lr where the first letter defines upper/lower and the second defines left/right.

source
Luna.Plotting.get_modesMethod
get_modes(output)

Determine whether output contains a multimode simulation, and if so, return the names of the modes.

source
Luna.Plotting.prop_2DFunction
prop_2D(output, specaxis=:f)

Make false-colour propagation plots for output, using spectral x-axis specaxis (see getIω). For multimode simulations, create one figure for each mode plus one for the sum of all modes.

Keyword arguments

  • λrange::Tuple(Float64, Float64) : x-axis limits for spectral plot (wavelength in metres)
  • trange::Tuple(Float64, Float64) : x-axis limits for time-domain plot (time in seconds)
  • dBmin::Float64 : lower colour-scale limit for logarithmic spectral plot
  • resolution::Real smooth the spectral energy density as defined by getIω.
source
Luna.Plotting.should_log10Function
should_log10(A, tolfac=10)

For multi-line plots, determine whether data for different lines contained in A spans a sufficiently large range that a logarithmic scale should be used. By default, this is the case when there is any point where the lines are different by more than a factor of 10.

source
Luna.Plotting.spec_1DFunction
spec_1D(output, zslice, specaxis=:λ, log10=true, log10min=1e-6)

Create lineplots of spectral-domain slices of the propagation.

The x-axis is determined by specaxis (see getIω).

If log10 is true, plot on a logarithmic scale, with a y-axis range of log10min.

The keyword argument modes selects which modes (if present) are to be plotted, and can be a single index, a range or :sum. In the latter case, the sum of modes is plotted.

Other kwargs are passed onto plt.plot.

source
Luna.Plotting.statsMethod
stats(output; kwargs...)

Plot all statistics available in output. Additional kwargs are passed onto plt.plot()

source
Luna.Plotting.subplotgridFunction
subplotgrid(N, portrait=true, kwargs...)

Create a figure with N subplots laid out in a grid that is as close to square as possible. If portrait is true, try to lay out the grid in portrait orientation (taller than wide), otherwise landscape (wider than tall).

source
Luna.Plotting.time_1DFunction
time_1D(output, zslice, y=:Pt, kwargs...)

Create lineplots of time-domain slice(s) of the propagation.

The keyword argument y determines what is plotted: :Pt (power, default), :Esq (squared electric field) or :Et (electric field).

The keyword argument modes selects which modes (if present) are to be plotted, and can be a single index, a range or :sum. In the latter case, the sum of modes is plotted.

The keyword argument oversampling determines the amount of oversampling done before plotting.

Other kwargs are passed onto plt.plot.

source