sarracen.SarracenDataFrame.lineplot

SarracenDataFrame.lineplot(target: str, x: str | None = None, y: str | None = None, z: str | None = None, kernel: BaseKernel | None = None, pixels: int = 512, xlim: Tuple[float, float] | None = None, ylim: Tuple[float, float] | None = None, zlim: Tuple[float, float] | None = None, ax: Axes | None = None, backend: str | None = None, log_scale: bool = False, dens_weight: bool = False, normalize: bool = False, hmin: bool = False, **kwargs: Any) Axes

Render a scalar SPH target variable to line plot.

Parameters:
  • data (SarracenDataFrame) – Particle data, in a SarracenDataFrame.

  • target (str) – Column label of the target variable.

  • x (str, optional) – Column labels of the x, y & z directional axes. Defaults to the columns detected in data.

  • y (str, optional) – Column labels of the x, y & z directional axes. Defaults to the columns detected in data.

  • z (str, optional) – Column labels of the x, y & z directional axes. Defaults to the columns detected in data.

  • kernel (BaseKernel, optional) – Kernel to use for smoothing the target data. Defaults to the kernel specified in data.

  • pixels (int, optional) – Number of samples taken across the x axis in the final plot.

  • xlim (tuple of float, optional) – Coordinates of the two points that make up the cross-sectional line.

  • ylim (tuple of float, optional) – Coordinates of the two points that make up the cross-sectional line.

  • zlim (tuple of float, optional) – Coordinates of the two points that make up the cross-sectional line.

  • ax (Axes, optional) – The main axes in which to draw the final plot.

  • backend (['cpu', 'gpu'], optional) – The computation backend to use when interpolating this data. Defaults to ‘gpu’ if CUDA is enabled, otherwise ‘cpu’ is used. A manually specified backend in data will override the default.

  • log_scale (bool, optional) – Whether to use a logarithmic scale for color coding.

  • dens_weight (bool, optional) – If True, will plot the target mutliplied by the density. Defaults to False.

  • normalize (bool, optional) – If True, will normalize the interpolation. Defaults to False (this may change in future versions).

  • hmin (bool, optional) – If True, a minimum smoothing length of 0.5 * pixel size will be imposed. This ensures each particle contributes to at least one grid cell / pixel. Defaults to False (this may change in a future verison).

  • kwargs (other keyword arguments) – Keyword arguments to pass to sns.lineplot.

Returns:

The resulting matplotlib axes, which contain the 2d rendered image.

Return type:

Axes

Raises:
  • ValueError – If x_pixels or y_pixels are less than or equal to zero, or if the specified x and y minimum and maximums result in an invalid region.

  • KeyError – If target, x, y, mass, density, or smoothing length columns do not exist in data.