Alphabetical list Categories
clipy Clip data at given y-values for plotting
Call signature:

clipy(xx, yy, ymin=None, ymax=None)

Help text:

xx, yy = clipy(xx, yy, ymin, ymax) finds runs in the data where ymin <= yy <= ymax and returns those runs, placing np.nan in between runs. At the beginning and end of each run, a point (X, ymin) or (X, ymax) is inserted that marks the linearly interpolated location where the run passes through the threshold.
This is useful for plotting, because qplot does not implement xlim and ylim with a proper clip rectangle.

Example:

import qplot as qp

import numpy as np

qp.figure('clipy', 3, 3)

xx = np.linspace(0, 4*np.pi, 100)

yy = np.sin(xx)

xx1, yy1 = qp.clipy(xx, yy, -.8, .8)

qp.plot(xx1, yy1)

QPlot Documentation — (C) Daniel Wagenaar, 2014–2023