voidfindertk.core.plot_acc module
Module for plotting data related to boxes and voids.
- class voidfindertk.core.plot_acc.BoxPlotter(box)[source]
Bases:
AccessorABCPlotter: Plotter object that plots the boxes.
- _abc_impl = <_abc._abc_data object>
- _default_kind = 'hist2d'
Default method to execute.
- hist2d(x, y, *, ax=None, **kwargs)[source]
Create a 2D histogram plot.
This method generates a 2D histogram plot of the specified x and y data from the box. It uses seaborn’s histplot function for visualization.
- Parameters:
x (str) – The name of the attribute in the box for the x-axis data.
y (str) – The name of the attribute in the box for the y-axis data.
ax (matplotlib.axes.Axes, optional) – The axes on which to plot. If None, the current axes are used.
**kwargs – Additional keyword arguments passed to the seaborn histplot.
- Returns:
ax – The axes with the histogram plot.
- Return type:
matplotlib.axes.Axes
Notes
The x and y attributes in the box should have a unit attribute for labeling the axes correctly.
- class voidfindertk.core.plot_acc.VoidPlotter(voids)[source]
Bases:
AccessorABCPlotter: Plotter object that plots the voids.
- _abc_impl = <_abc._abc_data object>
- _default_kind = 'void_size_function'
Default method to execute.
- void_galaxy_corr(ax=None, **kwargs)[source]
Compute the Void-Galaxy Correlation Function (VGCF) and plot the result.
This method calculates the Void-Galaxy Correlation Function (VGCF) over a range of radii and plots the result on the provided axis. If no axis is provided, it will use the current active axis.
- Parameters:
max_radius_search (float) – The maximum radius to search for void-galaxy correlations (in the same units as the box dimensions).
delta_rad (float, optional, default: 1) – The radial bin size for calculating the correlation function.
n_jobs (int, optional, default: 1) – The number of parallel jobs to run for the correlation function calculation.
ax (matplotlib.axes.Axes, optional, default: None) – The axis on which to plot the result. If None, the current active axis is used.
- Returns:
ax – The axis with the Void-Galaxy Correlation Function plotted.
- Return type:
matplotlib.axes.Axes
- void_size_function(*, ax=None, **kwargs)[source]
Create a plot of the void size function.
This method generates a plot for the void size function using data derived from the voids. It visualizes the relationship between the logarithm of the radius and the density of voids.
- Parameters:
ax (matplotlib.axes.Axes, optional) – The axes on which to plot. If None, the current axes are used.
vsf_kws (dict, optional) – Additional keyword arguments passed to the void size function calculation.
**kwargs – Additional keyword arguments passed to the seaborn lineplot.
- Returns:
ax – The axes with the void size function plot.
- Return type:
matplotlib.axes.Axes
Notes
The x-axis is logarithmically scaled, and the y-axis represents the density of voids. The plot includes a grid and is titled with the density contrast.
- vsf(*, ax=None, **kwargs)
Create a plot of the void size function.
This method generates a plot for the void size function using data derived from the voids. It visualizes the relationship between the logarithm of the radius and the density of voids.
- Parameters:
ax (matplotlib.axes.Axes, optional) – The axes on which to plot. If None, the current axes are used.
vsf_kws (dict, optional) – Additional keyword arguments passed to the void size function calculation.
**kwargs – Additional keyword arguments passed to the seaborn lineplot.
- Returns:
ax – The axes with the void size function plot.
- Return type:
matplotlib.axes.Axes
Notes
The x-axis is logarithmically scaled, and the y-axis represents the density of voids. The plot includes a grid and is titled with the density contrast.