CLI Reference

This page provides a complete reference for the y2p command-line interface. The CLI is built with Click and offers commands for plotting, generating configurations, and inspecting data files.

y2p

yaml2plot (y2p) - a CLI tool for creating plots from YAML specifications and SPICE simulation waveforms.

Examples:

y2p init sim.raw > spec.yaml # Generate a boilerplate spec.yaml file from a raw file

y2p signals sim.raw # List available signals in a raw file, edit the spec.yaml file to plot the signals you want

y2p plot spec.yaml # Plot the signals in the spec.yaml file

Run subcommands with y2p <subcommand> –help for more information. See the latest Documentation at: [https://Jianxun.github.io/yaml2plot/]

y2p [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

init

Generate a sample plot_spec.yaml file from a raw file.

Use the default independent variable as the X axis.

Use y2p init sim.raw > spec.yaml to save the spec.yaml file.

y2p init [OPTIONS] RAW_FILE

Arguments

RAW_FILE

Required argument

plot

Plot SPICE waveforms using a specification file.

The raw file can be specified in three ways (in order of precedence): 1. –raw option (highest priority) 2. Second positional argument: y2p plot spec.yaml sim.raw 3. ‘raw:’ field in the YAML specification file (lowest priority)

Examples:

y2p plot spec.yaml # Uses raw: field from YAML y2p plot spec.yaml sim.raw # Uses positional argument y2p plot spec.yaml –raw sim.raw # Uses –raw option y2p plot spec.yaml –output plot.html # Save to file y2p plot spec.yaml –width 1200 –height 800 # Override dimensions y2p plot spec.yaml –title “My Analysis” # Override title

y2p plot [OPTIONS] SPEC_FILE [RAW_FILE]

Options

--raw <raw_override>

Override raw file path (takes precedence over spec file raw: field)

-o, --output <output_file>

Output file path (HTML, PNG, PDF, etc.). If not specified, plot will be displayed.

--width <width>

Plot width in pixels (overrides spec file)

--height <height>

Plot height in pixels (overrides spec file)

--title <title>

Plot title (overrides spec file)

--theme <theme>

Plot theme (overrides spec file)

Options:

plotly | plotly_white | plotly_dark | ggplot2 | seaborn | simple_white

--renderer <renderer>

Plotly renderer to use when displaying plot

Default:

'auto'

Options:

auto | browser | notebook | plotly_mimetype | json

Arguments

SPEC_FILE

Required argument

RAW_FILE

Optional argument

signals

List available signals in a SPICE raw file.

y2p signals [OPTIONS] RAW_FILE

Options

-l, --limit <limit>

Limit number of signals to display (default: 10)

-a, --all

Show all signals, ignoring the limit

--grep <grep>

Filter signals by regular expression

Arguments

RAW_FILE

Required argument

Examples:

y2p signals sim.raw

y2p signals sim.raw –limit 20

y2p signals sim.raw -a

y2p signals sim.raw –grep “v(”