Plotora1.0.0← LibraryScientific visualization, simplified.
DOCUMENTATION / REFERENCE

API reference

Public signatures generated from the RC1 source. Task guides explain units, assumptions and examples. Plotting helpers return Graph unless described otherwise. Common plotting options are described in Plotting and themes.

Figures and styling

Read the guide.

Graph

python
pt.Graph(fig: 'Any', axes: 'Any', data: 'Any' = None, metadata: 'dict' = <factory>, animation: 'Any' = None) -> None

Matplotlib-backed figure wrapper. Plot functions return this object.

Properties: ax (first axis), figure (alias of fig), axes, data, metadata.

figure

python
pt.figure(*, rows=1, cols=1, theme=None, figsize=(7, 4), **kwargs)

Create a native subplot layout.

themes

python
pt.themes() -> 'tuple[str, ...]'

List available theme names.

set_theme

python
pt.set_theme(name: 'str') -> 'None'

Set default theme.

register_theme

python
pt.register_theme(name: 'str', settings: 'dict', base: 'str' = 'academic') -> 'None'

Register an rcParams preset derived from a base theme.

style

python
pt.style(theme=None)

Return a Matplotlib rc_context.

Standard plots

Read the guide.

plot

python
pt.plot(x, y=None, **kwargs)

Line plot; if y is omitted, x is treated as y values.

line

python
pt.line(x, y=None, **kwargs)

Alias of plot.

scatter

python
pt.scatter(x, y, **kwargs)

Scatter points.

bar

python
pt.bar(x, y, **kwargs)

Vertical bars.

hist

python
pt.hist(values, **kwargs)

Histogram of values.

area

python
pt.area(x, y, **kwargs)

Filled area to baseline.

boxplot

python
pt.boxplot(values, **kwargs)

Box-and-whisker plot.

stem

python
pt.stem(x, y, **kwargs)

Discrete stem plot.

polar

python
pt.polar(theta, r, **kwargs)

Polar plot; theta in radians.

pie

python
pt.pie(values, **kwargs)

Pie chart.

heatmap

python
pt.heatmap(z, *, colorbar=True, **kwargs)

Image-style 2D heatmap.

contour

python
pt.contour(x, y, z, *, filled=False, colorbar=False, **kwargs)

Contour or filled contour of a coordinate grid.

vector_field

python
pt.vector_field(x, y, u, v, **kwargs)

2D quiver plot.

errorbar

python
pt.errorbar(x, y, **kwargs)

Error bars using Matplotlib artist options.

compare

python
pt.compare(*series, **kwargs)

Compare tuples (x, y, label), with label optional.

LTspice

Read the guide.

Simulation

python
pt.Simulation(axis_name: str, runs: list[pandas.core.frame.DataFrame], step_names: list[str]) -> None

Container for axis name, DataFrame runs and step labels.

Property: traces lists available trace names. runs holds DataFrames and step_names holds labels.

read_ltspice

python
pt.read_ltspice(path)

Read exported text or optional native RAW into Simulation.

ltspice

python
pt.ltspice(path, *, traces=None, time_unit='auto', step=None, component='magnitude', window=None, **kwargs)

Plot selected traces and steps.

compare_ltspice

python
pt.compare_ltspice(*paths, trace, labels=None, time_unit='ms', **kwargs)

Compare single-run transient files.

Engineering

Read the guide.

transfer_function

python
pt.transfer_function(num, den)

Return a SciPy continuous-time transfer function.

bode

python
pt.bode(num=None, den=None, *, system=None, w=None, unit='rad/s', theme=None, figsize=(7, 6), title=None)

Return exact sampled magnitude and phase graphs.

bode_asymptotic

python
pt.bode_asymptotic(num, den, *, w=None, unit='rad/s', theme=None)

Compare exact and straight-line magnitude responses.

corner_frequencies

python
pt.corner_frequencies(num, den, *, unit='rad/s')

Return magnitudes of roots in selected units.

poles_zeros

python
pt.poles_zeros(*, poles=None, zeros=None, num=None, den=None, **kwargs)

Plot poles and zeros from roots or coefficients.

nyquist

python
pt.nyquist(num=None, den=None, *, system=None, w=None, unit='rad/s', **kwargs)

Plot sampled complex frequency response and its conjugate.

step_response

python
pt.step_response(num=None, den=None, *, system=None, t=None, **kwargs)

Plot continuous-time unit step response.

impulse_response

python
pt.impulse_response(num=None, den=None, *, system=None, t=None, **kwargs)

Plot continuous-time impulse response.

root_locus

python
pt.root_locus(num, den, *, gains=None, **kwargs)

Sample closed-loop roots for specified gains.

stability_margins

python
pt.stability_margins(num, den)

Return margin dictionary using optional control.

bandwidth

python
pt.bandwidth(num, den)

Return bandwidth in rad/s using optional control.

phasors

python
pt.phasors(values, **kwargs)

Plot named complex values from a dictionary.

impedance

python
pt.impedance(f, z, **kwargs)

Plot magnitude of complex impedance versus frequency.

power_triangle

python
pt.power_triangle(p, q, **kwargs)

Plot active/reactive components and record apparent power.

Signals

Read the guide.

metrics

python
pt.metrics(t, y, *, window=None)

Return time-weighted signal statistics for real samples.

ripple

python
pt.ripple(t, y, *, window=None)

Return peak-to-peak value in the selected time window.

peaks

python
pt.peaks(y, **kwargs)

Return SciPy peak indices and properties.

resample

python
pt.resample(t, y, *, samples=None)

Return uniform time grid and linearly interpolated values.

spectrum

python
pt.spectrum(t, y, *, window=None, **kwargs)

Plot one-sided amplitude spectrum; requires uniform time samples.

fft

python
pt.fft(t, y, *, window=None, **kwargs)

Alias of spectrum.

spectrogram

python
pt.spectrogram(t, y, *, nperseg=256, **kwargs)

Plot PSD versus time and frequency.

timing

python
pt.timing(t, channels, **kwargs)

Plot named discrete channels as offset step traces.

harmonics

python
pt.harmonics(t, y, fundamental, *, count=10)

Fit harmonic amplitudes and phases by least squares.

phase_difference

python
pt.phase_difference(t, y1, y2, frequency)

Return phase of the second signal minus first, in degrees.

Mathematics

Read the guide.

function

python
pt.function(expr, domain=(-10, 10), *, samples=1000, **kwargs)

Sample a real expression of x or callable.

parametric

python
pt.parametric(xexpr, yexpr, domain=(0, 6.283185307179586), *, samples=1000, **kwargs)

Plot x(t), y(t) over a parameter range.

taylor

python
pt.taylor(expr, degree=5, center=0, domain=(-3, 3), *, samples=1000, **kwargs)

Compare expression with symbolic Taylor polynomial.

derivative

python
pt.derivative(expr, domain=(-3, 3), **kwargs)

Plot symbolic derivative.

tangent

python
pt.tangent(expr, at, domain=(-3, 3), **kwargs)

Compare function and tangent at selected x.

integral

python
pt.integral(expr, a, b, *, samples=1000, **kwargs)

Shade integral region and report quadrature in metadata.

implicit

python
pt.implicit(expr, xlim=(-3, 3), ylim=(-3, 3), *, samples=250, **kwargs)

Plot zero-level contour or equality in x and y.

direction_field

python
pt.direction_field(expr, xlim=(-3, 3), ylim=(-3, 3), *, samples=20, **kwargs)

Plot normalized slope field dy/dx.

ode

python
pt.ode(rhs, tspan, y0, *, samples=500, rtol=1e-08, atol=1e-10, **kwargs)

Solve an initial value ODE and plot solution components.

vectors

python
pt.vectors(vectors, **kwargs)

Plot named 2D vectors as arrows.

transform

python
pt.transform(matrix, vectors, **kwargs)

Compare original and matrix-transformed point sequences.

fourier

python
pt.fourier(expr, terms=10, period=6.283185307179586, *, samples=1000, **kwargs)

Compare expression with truncated Fourier series.

sequence

python
pt.sequence(values, **kwargs)

Stem plot indexed from one.

Statistics

Read the guide.

describe

python
pt.describe(y)

Return descriptive statistics, including sample variance.

regression

python
pt.regression(x, y, *, degree=1, model='polynomial', confidence=0.95, interval=None, **kwargs)

Fit polynomial, logarithmic or exponential model.

curve_fit

python
pt.curve_fit(x, y, func, *, p0=None, bounds=(-inf, inf), **kwargs)

Fit callable nonlinear model and record covariance.

residuals

python
pt.residuals(x, fit, **kwargs)

Plot residuals from regression or curve_fit metadata.

distribution

python
pt.distribution(name='norm', *, params=(), domain=None, **kwargs)

Plot supported continuous probability density.

correlation

python
pt.correlation(data, **kwargs)

Plot numeric DataFrame correlation matrix.

outliers

python
pt.outliers(y, *, threshold=3)

Return indices with absolute z-score above threshold.

integrate_data

python
pt.integrate_data(x, y)

Return trapezoidal integral.

differentiate_data

python
pt.differentiate_data(x, y)

Return finite-difference gradient.

interpolate_data

python
pt.interpolate_data(x, y, new_x, *, kind='linear')

Interpolate within the sample bounds.

smooth

python
pt.smooth(y, *, window=11, degree=2)

Apply Savitzky–Golay filter.

moving_average

python
pt.moving_average(y, window=5)

Return valid-window moving average (shorter output).

propagate

python
pt.propagate(func, values, standard_uncertainties, *, covariance=None)

Return nominal value and first-order standard uncertainty.

3D

Read the guide.

surface

python
pt.surface(x, y=None, z=None, *, domain=((-3, 3), (-3, 3)), samples=80, **kwargs)

Plot 3D surface from expression, callable or coordinate grid.

wireframe

python
pt.wireframe(x, y=None, z=None, *, domain=((-3, 3), (-3, 3)), samples=50, **kwargs)

Plot 3D wireframe.

scatter3d

python
pt.scatter3d(x, y, z, **kwargs)

Plot 3D points.

line3d

python
pt.line3d(x, y, z, **kwargs)

Plot 3D curve.

vector_field3d

python
pt.vector_field3d(x, y, z, u, v, w, **kwargs)

Plot 3D quiver arrows.

contour3d

python
pt.contour3d(x, y, z, **kwargs)

Plot 3D contours.

Data and units

Read the guide.

load

python
pt.load(path, **kwargs)

Load supported table or MATLAB arrays.

from_file

python
pt.from_file(path, x, y, **kwargs)

Load table and plot named x/y columns.

clean

python
pt.clean(data, *, columns=None, dropna=False, sort=None, fill=None)

Copy and filter, fill, drop or sort table rows.

normalize

python
pt.normalize(y)

Return min-max scaled values.

merge

python
pt.merge(*frames, **kwargs)

Merge tables using pandas options.

export_data

python
pt.export_data(data, path, **kwargs)

Write tabular data to supported format.

convert

python
pt.convert(value, from_unit, to_unit)

Convert compatible physical units; arbitrary units need Pint.

Export

Read the guide.

animate

python
pt.animate(x, frames, *, interval=67, repeat=True, **kwargs)

Create a line animation from frame values.

latex_figure

python
pt.latex_figure(filename, caption, label, width='0.9\\linewidth')

Return LaTeX figure snippet.

Plotora 1.0.0 · Release candidate documentation