Methods

Index

UnicodePlots

AstroPlot.unicode_scatterFunction
unicode_scatter(
    data::Array{T<:AbstractPoint, N};
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.BrailleCanvas, _A}
unicode_scatter(
    data::Array{T<:AbstractPoint, N},
    u::Union{Nothing, Unitful.FreeUnits};
    xaxis,
    yaxis,
    xlabel,
    ylabel,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.BrailleCanvas, _A}

Scatter plot of points or particles in REPL

collection: filter the type of particles

Keywords

  • xaxis: Symbol to plot on x-axis. Default is :x
  • yaxis: Symbol to plot on y-axis. Defualt is :y
  • xlabel: label of x-axis
  • ylabel: label of y-axis

Examples

julia> unicode_scatter(randn_pvector(100))

AstroPlot.unicode_densityFunction
unicode_density(data; ...) -> Any
unicode_density(
    data,
    units;
    timestamp,
    xlabel,
    ylabel,
    ts,
    title,
    kw...
) -> Any

Plot radial mass density curve of spherically symmetric system in REPL

Keywords

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • timestamp: print time on figure title

AstroPlot.unicode_forceFunction
unicode_force(
    data;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.Canvas, _A}
unicode_force(
    data,
    units;
    timestamp,
    savelog,
    savefolder,
    xlabel,
    ylabel,
    ts,
    title,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.Canvas, _A}

Plot acceleration magnitude distribution of spherically symmetric system in REPL

Keywords

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • timestamp: print time on figure title

AstroPlot.unicode_radialforceFunction
unicode_radialforce(
    data;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.Canvas, _A}
unicode_radialforce(
    data,
    units;
    timestamp,
    savelog,
    savefolder,
    xlabel,
    ylabel,
    ts,
    title,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.Canvas, _A}

Plot radial acceleration magnitude relative to center in REPL

Keywords

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • timestamp: print time on figure title

Missing docstring.

Missing docstring for unicode_radialpotential. Check Documenter's build log for details.

AstroPlot.unicode_rotationcurveFunction
unicode_rotationcurve(data; ...) -> Any
unicode_rotationcurve(
    data,
    units;
    timestamp,
    section,
    rmhead,
    rmtail,
    savelog,
    savefolder,
    xlabel,
    ylabel,
    ts,
    title,
    kw...
) -> Any

Plot rotation curve in REPL

Keywords

  • rmhead: remove the first rmhead elements of result array. Useful to avoid improper data points

  • rmtail: remove the last rmtail elements of result array. Useful to avoid improper data points

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function

  • savefolder: set the directory to save log file

  • section::Int64: number of bins. Default is floor(Int64, length(data)^0.5833333333333334)

AstroPlot.unicode_projectionFunction
unicode_projection(
    ρ;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}
unicode_projection(
    ρ,
    units;
    xaxis,
    yaxis,
    xlabel,
    ylabel,
    zlabel,
    title,
    colormap,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}

Plot 2D projection sum over one dimension.

Keywords

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • colormap = :inferno: color map of heatmap plot

AstroPlot.unicode_projection_densityFunction
unicode_projection_density(
    mesh::MeshCartesianStatic;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}
unicode_projection_density(
    mesh::MeshCartesianStatic,
    units;
    xaxis,
    yaxis,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}

Plot 2D projection sum of mesh density over one dimension.

Keywords

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • colormap = :inferno: color map of heatmap plot

AstroPlot.unicode_sliceFunction
unicode_slice(
    data::AbstractArray{T, 3},
    n::Int64;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}
unicode_slice(
    data::AbstractArray{T, 3},
    n::Int64,
    units;
    xaxis,
    yaxis,
    xlabel,
    ylabel,
    colormap,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}

Plot 2D slice of a 3D array. Vector plot is not supported in unicode mode.

Keywords

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • colormap = :inferno: color map of heatmap plot

unicode_slice(
    m::MeshCartesianStatic,
    symbol::Symbol,
    n::Int64;
    ...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}
unicode_slice(
    m::MeshCartesianStatic,
    symbol::Symbol,
    n::Int64,
    units;
    xaxis,
    yaxis,
    kw...
) -> UnicodePlots.Plot{T, Val{_A}} where {T<:UnicodePlots.HeatmapCanvas, _A}

Plot 2D slice of 3D data symbol in m.

Keywords

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • colormap = :inferno: color map of heatmap plot

GLMakie

AstroPlot.plot_makieFunction
plot_makie(
    data::Array{T<:PVector, 1};
    ...
) -> Makie.FigureAxisPlot
plot_makie(
    data::Array{T<:PVector, 1},
    u::Union{Nothing, Unitful.FreeUnits};
    markersize,
    markerspace,
    size,
    kw...
) -> Makie.FigureAxisPlot

Plot scatter data points (in interactive mode)

collection: filter the type of particles

Examples

d = randn_pvector(50)
plot_makie(d, nothing)

d = randn_pvector(50, u"km")
plot_makie(d, u"m")
plot_makie(
    nodes::Array{T<:OctreeNode, N};
    ...
) -> Tuple{Makie.Figure, Any, MakieCore.Wireframe{T} where T<:Tuple{GeometryBasics.Rect3}}
plot_makie(
    nodes::Array{T<:OctreeNode, N},
    u;
    interactive,
    kw...
) -> Tuple{Makie.Figure, Any, MakieCore.Wireframe{T} where T<:Tuple{GeometryBasics.Rect3}}

Plot tree nodes in wireframe mode

AstroPlot.plot_makie!Function
plot_makie!(fig, data::Array{T<:PVector, 1}; ...) -> Any
plot_makie!(
    fig,
    data::Array{T<:PVector, 1},
    u::Union{Nothing, Unitful.FreeUnits};
    markersize,
    markerspace,
    size,
    kw...
) -> Any

Plot scatter data points (in interactive mode)

collection: filter the type of particles

Examples

d = randn_pvector(50)
plot_makie!(fig, d, nothing)

d = randn_pvector(50, u"km")
plot_makie!(fig, d, u"m")
plot_makie!(
    axis,
    nodes::AbstractArray{T<:OctreeNode, N};
    ...
) -> Any
plot_makie!(
    axis,
    nodes::AbstractArray{T<:OctreeNode, N},
    u;
    kw...
) -> Any

Plot tree nodes in wireframe mode

AstroPlot.plot_peanoFunction
plot_peano() -> Any
plot_peano(bits::Int64) -> Any

Interactively plot Hilber-Peano curve with Makie. It is recommanded that bits <= 6 to avoid lagging problems.

GLMakie

Missing docstring.

Missing docstring for projection. Check Documenter's build log for details.

AstroPlot.projection_densityFunction
projection_density(m::MeshCartesianStatic; ...)
projection_density(
    m::MeshCartesianStatic,
    units;
    size,
    xaxis,
    yaxis,
    xlabel,
    ylabel,
    title,
    aspect_ratio,
    kw...
)

Plot 2D projection sum of mesh density over one dimension.

Keywords

  • aspect_ratio: aspect ratio of axes. Default is 1.0 to avoid stretching. Pass to Makie as AxisAspect(aspect_ratio)

  • size: figure size

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • xlims: set x-limit of the plot. Default is nothing

  • ylims: set y-limit of the plot. Default is nothing

AstroPlot.plot_sliceFunction
plot_slice(
    m::MeshCartesianStatic,
    symbol::Symbol,
    n::Int64;
    ...
) -> Makie.Figure
plot_slice(
    m::MeshCartesianStatic,
    symbol::Symbol,
    n::Int64,
    units;
    size,
    xaxis,
    yaxis,
    xlabel,
    ylabel,
    title,
    aspect,
    kw...
) -> Makie.Figure

Plot 2D slice of 3D data symbol in m.

Keywords

  • size: figure size

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • xlims: set x-limit of the plot. Default is nothing

  • ylims: set y-limit of the plot. Default is nothing

  • aspect_ratio: aspect ratio of axes. Default is 1.0 to avoid stretching. Pass to Makie as AxisAspect(aspect_ratio)

Video

AstroPlot.png2videoFunction
png2video(
    dir::String,
    filenamebase::String,
    suffix::String,
    outfile::String;
    encoder_options,
    framerate,
    codec_name
) -> Bool

Convert all figure end with suffix to video. Filenames are organized as filenamebase0000suffix. For png files like pos_0000.png, set filenamebase = "pos_" and suffix = ".png"

It basically calls VideoIO.open_video_out

Keywords

  • encoder_options: keywords supported by FFMPEG. Default value (crf=23, preset="medium") is suitable for most cases
  • framerate: fps (frame per second). Default 24
  • codec_name: name of video encoder. Default nothing. Try libx264, libx265, libx264rgb and more options in FFMPEG

Examples

julia> png2video("output", "pos_", ".png", "test.mp4")
MosaicViews.mosaicviewFunction
mosaicview(
    folder::String,
    filenamebase::String,
    Counts::Array,
    suffix::String;
    formatstring,
    kw...
) -> Any

Arguments

  • folder: directory holding snapshots
  • filenamebase, Counts, suffix: snapshots are commonly named as snapshot_0000.gadget2, in this way filenamebase = "snapshot_", suffix = ".gadget2. Counts is an array to choose snapshots, and it is printed to formatted string (controled by keyword formatstring) in for loops.

Examples

julia> mosaicview("output", "pos_", collect(0:10:490), ".png"; fillvalue=0.5, npad=5, ncol=10, rowmajor=true)
mosaicview(
    folder::String,
    filenamebase::String,
    suffix::String;
    kw...
) -> Any

Plot all files matching filenamebase and suffix in folder to mosaic view.

Tools

Analysis

AstroPlot.rotationcurveFunction
rotationcurve(data; ...) -> NTuple{4, Vector}
rotationcurve(
    data,
    units;
    rmhead,
    rmtail,
    section,
    savelog,
    savefolder
) -> NTuple{4, Vector}

Return Tuple(Rmean, Vmean, Rstd, Vstd), where mean is mean value, std means standard deviation.

Keywords

  • rmhead: remove the first rmhead elements of result array. Useful to avoid improper data points

  • rmtail: remove the last rmtail elements of result array. Useful to avoid improper data points

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function

  • savefolder: set the directory to save log file

  • section::Int64: number of bins. Default is floor(Int64, length(data)^0.5833333333333334)

AstroPlot.densitycurveFunction
densitycurve(data; ...) -> Tuple{Vector, Vector}
densitycurve(
    data,
    units;
    savelog,
    savefolder
) -> Tuple{Vector, Vector}

Compute radial mass density curve of spherically symmetric system

Keywords

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function
  • savefolder: set the directory to save log file
AstroPlot.rotvelFunction
rotvel(vel::PVector, pos::PVector) -> Any

Rotational velocity magnitude at pos relative to origin.

AstroPlot.radialvelFunction
radialvel(vel::PVector, pos::PVector) -> Any

Radial velocity magnitude at pos relative to origin.

AstroPlot.forceFunction
force(data; ...) -> Tuple{Any, Any}
force(data, units; savelog, savefolder) -> Tuple{Any, Any}

Compute acceleration magnitude distribution of spherically symmetric system

Keywords

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function
  • savefolder: set the directory to save log file
AstroPlot.radialforceFunction
radialforce(a0, acc, p0, pos) -> Any

Compute radial acceleration magnitude relative to center p0

radialforce(data; ...) -> Tuple{Any, Any}
radialforce(
    data,
    units;
    savelog,
    savefolder
) -> Tuple{Any, Any}

Compute radial acceleration magnitude relative to center

Keywords

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function
  • savefolder: set the directory to save log file
Missing docstring.

Missing docstring for radialpotential. Check Documenter's build log for details.

AstroPlot.distributionFunction
distribution(
    x::Array,
    y::Array;
    section,
    rmhead,
    rmtail
) -> NTuple{4, Vector}

Compute how quantity y is distributed along x. For example, rotation velocity along radius. Return Tuple(xmean, ymean, xstd, ystd), where mean is mean value, std means standard deviation.

Keywords

  • section::Int64: number of bins. Default is floor(Int64, length(data)^0.5833333333333334)

  • rmhead: remove the first rmhead elements of result array. Useful to avoid improper data points

  • rmtail: remove the last rmtail elements of result array. Useful to avoid improper data points

AstroPlot.pos_from_centerFunction
pos_from_center(
    particles::AbstractArray{T<:AbstractParticle, 1}
) -> Any
pos_from_center(
    particles::AbstractArray{T<:AbstractParticle, 1},
    u
) -> Any

Return a unitless array of positions relative to the center.

AstroPlot.lagrange_radiiFunction
lagrange_radii(data) -> Tuple{Any, Any}
lagrange_radii(data, u) -> Tuple{Any, Any}

Return a Tuple of scale radius and Lagrange radii. Designed for spherically symmetric systems.

Data processing

Missing docstring.

Missing docstring for pack_xy. Check Documenter's build log for details.

AstroPlot.sortarrays!Function
sortarrays!(by::Array, another::Array; kw...)

Sort two arrays at the same time. kw is passed to Base.sort!.

Examples

julia> a = [1,3,2]
julia> b = ["a", "b", "c"]
julia> sortarrays!(a,b)
julia> a
3-element Vector{Int64}:
 1
 2
 3

julia> b
3-element Vector{String}:
 "a"
 "c"
 "b"
Missing docstring.

Missing docstring for pos_from_center. Check Documenter's build log for details.

Meshes

AstroPlot.axisidFunction
axisid(axis::Symbol) -> Int64

Convert axis to Int

  • return 1 if axis == :x
  • return 2 if axis == :y
  • return 3 if axis == :z
AstroPlot.axis_cartesianFunction
axis_cartesian(pos::StructArray, axis::Symbol) -> Any

Return 1D axis points of 3D Cartesian positions.

Missing docstring.

Missing docstring for slice3d. Check Documenter's build log for details.

energy evolution

plot_energy
plot_energy_kinetic
plot_energy_potential
plot_energy_delta
plot_energy_delta!
kinetic_energy
sum_kinetic
sum_potential

momentum evolution

AstroPlot.plot_momentumFunction
plot_momentum(
    df::DataFrames.DataFrame;
    uTime,
    uMomentum,
    title,
    xlabel,
    ylabel,
    size,
    legendposition,
    axis,
    colors,
    kw...
) -> Tuple{Makie.Figure, DataFrames.DataFrame}

Plot total momentum in df which contains columns named time and momentum

Keywords

  • size: figure size
  • xaxis: Symbol to plot on x-axis. Default is :x
  • yaxis: Symbol to plot on y-axis. Defualt is :y
  • xlabel: label of x-axis
  • ylabel: label of y-axis
  • title: title line of the figure
  • xlims: set x-limit of the plot. Default is nothing
  • ylims: set y-limit of the plot. Default is nothing
plot_momentum(
    datafile::String;
    kw...
) -> Tuple{Makie.Figure, DataFrames.DataFrame}

Plot total momentum in datafile which is a CSV file containing columns named time and momentum

Keywords

  • size: figure size
  • xaxis: Symbol to plot on x-axis. Default is :x
  • yaxis: Symbol to plot on y-axis. Defualt is :y
  • xlabel: label of x-axis
  • ylabel: label of y-axis
  • title: title line of the figure
  • xlims: set x-limit of the plot. Default is nothing
  • ylims: set y-limit of the plot. Default is nothing
plot_momentum(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType;
    ...
) -> Tuple{Tuple{Makie.Figure, DataFrames.DataFrame}, Tuple{Makie.Figure, DataFrames.DataFrame}}
plot_momentum(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units;
    ...
) -> Tuple{Tuple{Makie.Figure, DataFrames.DataFrame}, Tuple{Makie.Figure, DataFrames.DataFrame}}
plot_momentum(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units,
    fileunits;
    times,
    savelog,
    savefolder,
    formatstring,
    type,
    kw...
) -> Tuple{Tuple{Makie.Figure, DataFrames.DataFrame}, Tuple{Makie.Figure, DataFrames.DataFrame}}

Plot total momentum and total angular momentum of particles in each snapshot.

Arguments

  • folder: directory holding snapshots
  • filenamebase, Counts, suffix: snapshots are commonly named as snapshot_0000.gadget2, in this way filenamebase = "snapshot_", suffix = ".gadget2. Counts is an array to choose snapshots, and it is printed to formatted string (controled by keyword formatstring) in for loops.
  • times: set time label of each snapshot
  • FileType: Trait argument to dispatch on different snapshot format. It is to be set manually because some output types cannot be deduced automatically
  • u = u"kpc": length unit. Set u as nothing in unitless cases.

Keywords

  • formatstring: formatted string to control snapshot index. Default is "%04d"

  • size: figure size

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • xlims: set x-limit of the plot. Default is nothing

  • ylims: set y-limit of the plot. Default is nothing

  • savelog::Bool: if true, save processed data in csv. The name of log file depends on analysis function

  • savefolder: set the directory to save log file

AstroPlot.plot_momentum_angularFunction
plot_momentum_angular(
    df::DataFrames.DataFrame;
    uTime,
    uMomentumAngular,
    title,
    xlabel,
    ylabel,
    size,
    legendposition,
    axis,
    colors,
    kw...
) -> Tuple{Makie.Figure, DataFrames.DataFrame}

Plot total angular momentum in df which contains columns named time and angularmomentum

Keywords

  • size: figure size
  • xaxis: Symbol to plot on x-axis. Default is :x
  • yaxis: Symbol to plot on y-axis. Defualt is :y
  • xlabel: label of x-axis
  • ylabel: label of y-axis
  • title: title line of the figure
  • xlims: set x-limit of the plot. Default is nothing
  • ylims: set y-limit of the plot. Default is nothing
plot_momentum_angular(
    datafile::String;
    kw...
) -> Tuple{Makie.Figure, DataFrames.DataFrame}

Plot total angular momentum in datafile which is a CSV file containing columns named time and angularmomentum

Keywords

  • size: figure size
  • xaxis: Symbol to plot on x-axis. Default is :x
  • yaxis: Symbol to plot on y-axis. Defualt is :y
  • xlabel: label of x-axis
  • ylabel: label of y-axis
  • title: title line of the figure
  • xlims: set x-limit of the plot. Default is nothing
  • ylims: set y-limit of the plot. Default is nothing

radii evolution

AstroPlot.plot_scaleradiusFunction
plot_scaleradius(
    df::DataFrames.DataFrame,
    uTime,
    uLength;
    xlabel,
    ylabel,
    title,
    size,
    legend,
    kw...
) -> Makie.Figure

Plot evolution of scale radius by time. df contains columns named Time and ScaleRadius

Keywords

  • xlabel: label of x-axis

  • ylabel: label of y-axis

  • title: title line of the figure

  • size: figure size

AstroPlot.plot_lagrangeradiiFunction
plot_lagrangeradii(
    df::DataFrames.DataFrame,
    uTime,
    uLength;
    xlabel,
    ylabel,
    title,
    colors,
    size,
    kw...
) -> Makie.Figure

Plot evolution of Lagrange radii by time. df contains columns named Time and L10, L20, ..., L100

Keywords

  • title: title line of the figure

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

AstroPlot.plot_lagrangeradii!Function
plot_lagrangeradii!(
    fig,
    ax,
    df::DataFrames.DataFrame;
    colors,
    legend,
    kw...
) -> Tuple{Any, Vector{String}}

Plot evolution of Lagrange radii by time. df contains columns named Time and L10, L20, ..., L100

Keywords

  • title: title line of the figure

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

AstroPlot.plot_lagrangeradii90Function
plot_lagrangeradii90(
    df::DataFrames.DataFrame,
    uTime,
    uLength;
    xlabel,
    ylabel,
    title,
    size,
    kw...
) -> Makie.Figure

Plot evolution of Lagrange radii by time. df contains columns named Time and L10, L20, ..., L90 L100 is omitted, because in most cases, those escaping particles may over distort the figure.

Keywords

  • title: title line of the figure

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

AstroPlot.plot_lagrangeradii90!Function
plot_lagrangeradii90!(
    fig,
    ax,
    df::DataFrames.DataFrame;
    colors,
    legend,
    kw...
) -> Tuple{Any, Vector{String}}

Plot evolution of Lagrange radii by time. df contains columns named Time and L10, L20, ..., L90 L100 is omitted, because in most cases, those escaping particles may over distort the figure.

Keywords

  • title: title line of the figure

  • xaxis: Symbol to plot on x-axis. Default is :x

  • yaxis: Symbol to plot on y-axis. Defualt is :y

  • xlabel: label of x-axis

  • ylabel: label of y-axis

AstroPlot.plot_radiiFunction
plot_radii(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType;
    ...
) -> Tuple{Makie.Figure, Makie.Figure, DataFrames.DataFrame}
plot_radii(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units;
    ...
) -> Tuple{Makie.Figure, Makie.Figure, DataFrames.DataFrame}
plot_radii(
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units,
    fileunits;
    times,
    savelog,
    savefolder,
    formatstring,
    type,
    kw...
) -> Tuple{Makie.Figure, Makie.Figure, DataFrames.DataFrame}

Plot scale radius and Lagrange radii (up to 90% by default)

Return Tuple(FigScale, FigLagrange, df). df contains radii data

Arguments

  • folder: directory holding snapshots
  • filenamebase, Counts, suffix: snapshots are commonly named as snapshot_0000.gadget2, in this way filenamebase = "snapshot_", suffix = ".gadget2. Counts is an array to choose snapshots, and it is printed to formatted string (controled by keyword formatstring) in for loops.
  • times: set time label of each snapshot
  • FileType: Trait argument to dispatch on different snapshot format. It is to be set manually because some output types cannot be deduced automatically
  • u = u"kpc": length unit. Set u as nothing in unitless cases.

Keywords

  • formatstring: formatted string to control snapshot index. Default is "%04d"

Examples

julia> FigScale, FigLagrange, df = plot_radii(
    joinpath(pathof(AstroPlot), "../../test/snapshots"), "snapshot_", collect(0:20:200), ".gadget2", gadget2(),
    times = collect(0.0:0.01:0.1) * u"Gyr", title = "Radii plot")
AstroPlot.plot_radii!Function
plot_radii!(
    AxisScale,
    FigLagrange,
    AxisLagrange,
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType;
    ...
) -> DataFrames.DataFrame
plot_radii!(
    AxisScale,
    FigLagrange,
    AxisLagrange,
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units;
    ...
) -> DataFrames.DataFrame
plot_radii!(
    AxisScale,
    FigLagrange,
    AxisLagrange,
    folder::String,
    filenamebase::String,
    Counts::Vector{Int64},
    suffix::String,
    FileType::AbstractOutputType,
    units,
    fileunits;
    times,
    colors,
    savelog,
    savefolder,
    formatstring,
    type,
    kw...
) -> DataFrames.DataFrame

Plot scale radius and Lagrange radii (up to 90% by default) Return radii data in Dict

Arguments

  • AxisScale: Axis of scale radius figure
  • FigLagrange: Lagrange radii figure
  • AxisLagrange: Axis of Lagrange radii figure
  • folder: directory holding snapshots
  • filenamebase, Counts, suffix: snapshots are commonly named as snapshot_0000.gadget2, in this way filenamebase = "snapshot_", suffix = ".gadget2. Counts is an array to choose snapshots, and it is printed to formatted string (controled by keyword formatstring) in for loops.
  • times: set time label of each snapshot
  • FileType: Trait argument to dispatch on different snapshot format. It is to be set manually because some output types cannot be deduced automatically
  • u = u"kpc": length unit. Set u as nothing in unitless cases.

Keywords

  • formatstring: formatted string to control snapshot index. Default is "%04d"

Examples

julia> FigScale, FigLagrange, df = plot_radii(
    joinpath(pathof(AstroPlot), "../../test/snapshots"), "snapshot_", collect(0:20:200), ".gadget2", gadget2(),
    times = collect(0.0:0.01:0.1) * u"Gyr", title = "Radii plot")

force distribution

plot_force
plot_force!

density distribution

Missing docstring.

Missing docstring for plot_density. Check Documenter's build log for details.

Missing docstring.

Missing docstring for plot_density!. Check Documenter's build log for details.