voyagerpy.plotting.plot.contour_plot#
- voyagerpy.plotting.plot.contour_plot(ax: Axes, x: str | ndarray | Series, y: str | ndarray | Series, data: Any | None = None, shape: Tuple[int, int] = (100, 100), levels: int = 7, colors: str | Sequence[str] = 'cyan', linewidths: float | None = 1, origin: str | None = None) Axes#
Create a contour plot.
Creates contours from the data in
xandy. Ifdatais notNone, thenxandycan be column names indata. Otherwise,xandyare assumed to be numpy arrays or pandas Series.This function is a wrapper around
matplotlib.axes.Axes.contour(). For more information on the parameters, see the documentation.- Parameters:
ax (Axes) – The axes to plot on.
x (Union[str, np.ndarray, Series]) – The data to plot on the x-axis. If str, then
xis assumed to be a column name indata.y (Union[str, np.ndarray, Series]) – The data to plot on the y-axis. If str, then
yis assumed to be a column name indata.data (Any, optional) – Must be a mappable with the keys supplied by
xandyif they are of type str, by default Noneshape (Tuple[int, int], optional) – The shape of the grid the contours are computed for, by default (100, 100). The larger the shape, the finer the contours.
levels (int, optional) – The number of levels to use for the contours, by default 7
colors (Union[str, Sequence[str]], optional) – The color(s) to use for the contours, by default “cyan”. If a sequence, then the length must be equal to
levels.linewidths (Optional[float], optional) – The width of the contour lines, by default 1
origin (Optional[str], optional) – The origin of the coordinate system, by default None.
- Returns:
The axes with the contour plot.
- Return type:
Axes
- Raises:
ValueError – If
xoryare of type str anddatais None.