perda.plotting.parametric_trimmer#

perda.plotting.parametric_trimmer.plot_parametric_trimmer(x, y, timestamp_unit, timestamps=None, x_label='X', y_label='Y', title=None, layout_config=LayoutConfig(width=1200, height=700, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', title_x=0.5, title_xanchor='center', title_yanchor='top', grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, max_display_resolution=50), font_config=FontConfig(large=20, medium=14, small=10))[source]#

Interactive parametric curve trimmer with a dual-handle range slider.

Displays a 2D parametric scatter plot alongside an ipywidgets IntRangeSlider that trims which points are shown. Designed for use in Jupyter notebooks.

Parameters:
  • x (NDArray[float64]) – X-axis values.

  • y (NDArray[float64]) – Y-axis values. Must have the same length as x.

  • timestamp_unit (Timescale) – Unit for timestamp labels in the slider. Ignored if timestamps is None. Pass aly.data.timestamp_unit.

  • timestamps (NDArray[float64] | None, optional) – Timestamps corresponding to each point, shown in the slider labels. If None, slider labels show index only.

  • x_label (str, optional) – X-axis label.

  • y_label (str, optional) – Y-axis label.

  • title (str | None, optional) – Plot title.

  • layout_config (LayoutConfig, optional)

  • font_config (FontConfig, optional)

Return type:

ipywidgets.VBox

Examples

>>> from perda.plotting import plot_parametric_trimmer
>>> widget = plot_parametric_trimmer(
...     lon_arr, lat_arr, aly.data.timestamp_unit, timestamps=ts_arr, x_label="Longitude", y_label="Latitude"
... )
>>> display(widget)