Skip to content

Commit

Permalink
Update doc-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Aug 5, 2024
1 parent afdb317 commit f3b127a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/plot2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,52 @@ plot2d__ = let lines = nothing, sc = nothing, txt = nothing # Note: Must all be
end
end

"""
plot2d(pos::AbstractVector, reltime; zoom=true, front=false, segments=6, fig="", dz_zoom=1.5,
dz=-5.0, dx=-16.0, xlim=nothing, ylim=nothing, xy=nothing)
Display a video-like 2D particle system by calling `plot2d` in a loop.
# Arguments
- `pos`: a vector of 3D positions.
- `reltime`: The relative time. When called the first time, set to `0.0`.
- `zoom`: Whether to enable zooming (default: `true`).
- `front`: Whether using a front view (default: `false`, which means side view).
- `segments`: The number of tether segments (default: `6`).
- `fig`: The name of the figure to display (default: `""`).
- `dz_zoom`: The z-axis offset in zoom view (default: `1.5`).
- `dz`: The z-axis offset in normal view (default: `-5.0`).
- `dx`: The x-axis offset (default: `-16.0`).
- `xlim`: The x-axis limits (default: `nothing`).
- `ylim`: The y-axis limits (default: `nothing`) (for side view the z-axis).
- `xy`: The x-y coordinates of the text (default: `nothing`) (for side view the z-axis).
"""
function plot2d(pos::AbstractVector, reltime=0.0; kwargs...)
plot2d__(pos, reltime; kwargs...)
end

"""
plot2d(pos_matix::Matrix, reltime; zoom=true, front=false, segments=6, fig="", dz_zoom=1.5,
dz=-5.0, dx=-16.0, xlim=nothing, ylim=nothing, xy=nothing)
Display a video-like 2D particle system by calling `plot2d` in a loop.
# Arguments
- `pos_matix`: a matrix of 3D coordinates
- `reltime`: The relative time. When called the first time, set to `0.0`.
- `zoom`: Whether to enable zooming (default: `false`).
- `front`: Whether using a front view (default: `false`, which means side view).
- `segments`: The number of tether segments (default: `6`).
- `fig`: The name of the figure to display (default: `""`).
- `dz_zoom`: The z-axis offset in zoom view (default: `1.5`).
- `dz`: The z-axis offset in normal view (default: `-5.0`).
- `dx`: The x-axis offset (default: `-16.0`).
- `xlim`: The x-axis limits (default: `nothing`).
- `ylim`: The y-axis limits (default: `nothing`) (for side view the z-axis).
- `xy`: The x-y coordinates of the text (default: `nothing`) (for side view the z-axis).
"""
function plot2d(pos_matrix::Matrix, reltime; segments, zoom=false, xlim, ylim, xy)
pos_vectors = Vector{Float64}[]
for particle in 1:segments+1
Expand Down

0 comments on commit f3b127a

Please sign in to comment.