# Plotting

structure_factor.plotting.plot_poisson(x, axis, c='k', linestyle=(0, (5, 10)), label='Poisson')[source]

Plot the pair correlation function $$g_{poisson}$$ and the structure factor $$S_{poisson}$$ corresponding to the Poisson point process.

Parameters
• x (numpy.ndarray) – x coordinate.

• axis (plt.Axes) – Axis on which to add the plot.

• c (str, optional) – Color of the plot. see matplotlib . Defaults to “k”.

• linestyle (tuple, optional) – Linstyle of the plot. see linestyle. Defaults to (0, (5, 10)).

• label (regexp, optional) – Label of the plot. Defaults to “Poisson”.

Returns

Plot of the pair correlation function and the structure factor of the Poisson point process over x.

Return type

plt.Axes

structure_factor.plotting.plot_summary(x, y, axis, scale='log', label='mean $\\pm$ 3 $\\cdot$ std', fmt='b', ecolor='r', **binning_params)[source]

Loglog plot the summary results of _bin_statistics() i.e., means and errors bars (3 standard deviations).

Parameters
• x (numpy.ndarray) – x coordinate.

• y (numpy.ndarray) – y coordinate.

• axis (plt.Axes) – Axis on which to add the plot.

• label (regexp, optional) – Label of the plot. Defaults to r”mean $pm$ 3 $cdot$ std”.

Returns

Plot of the results of _bin_statistics() applied on x and y .

Return type

plt.Axes

structure_factor.plotting.plot_exact(x, y, axis, label)[source]

Loglog plot of a callable function y evaluated on the vector x.

Parameters
• x (numpy.ndarray) – x coordinate.

• y (numpy.ndarray) – y coordinate.

• axis (plt.Axes) – Axis on which to add the plot.

• label (regexp, optional) – Label of the plot.

Returns

Plot of y with respect to x.

Return type

plt.Axes

structure_factor.plotting.plot_approximation(x, y, axis, rasterized, label, color, linestyle, marker, markersize, scale='log')[source]

Loglog plot of y w.r.t. x.

Parameters
• x (numpy.ndarray) – x coordinate.

• y (numpy.ndarray) – y coordinate.

• axis (plt.Axes) – Axis on which to add the plot.

• rasterized (bool) – Rasterized option of matlplotlib.plot.

• label (regexp, optional) – Label of the plot.

• color (matplotlib.color) – Color of the plot. see color .

• linestyle (tuple) –

Style of the plot. see linestyle.

• marker (matplotlib.marker) – Marker of marker.

• markersize (float) – Marker size.

• scale (str, optional) – Trigger between plot scales of plt.Axes. Defaults to log.

Returns

Loglog plot of y w.r.t. x

Return type

plt.Axes

structure_factor.plotting.plot_estimation_showcase(k_norm, estimation, axis=None, scale='log', exact_sf=None, error_bar=False, label='$\\widehat{S}$', rasterized=True, file_name='', **binning_params)[source]

Loglog plot of the results of the scattering intensity scattering_intensity(), with the means and error bars over specific number of bins found via _bin_statistics().

Parameters
• k_norm (numpy.ndarray) – Wavenumbers.

• estimation (numpy.ndarray) – Scattering intensity corresponding to k_norm.

• axis (plt.Axes, optional) – Axis on which to add the plot. Defaults to None.

• scale (str, optional) – Trigger between plot scales of matplotlib.plot. Defaults to log.

• exact_sf (callable, optional) – Structure factor of the point process. Defaults to None.

• error_bar (bool, optional) – If True, k_norm and correspondingly estimation are divided into sub-intervals (bins). Over each bin, the mean and the standard deviation of estimation are derived and visualized on the plot. Note that each error bar corresponds to the mean +/- 3 standard deviation. To specify the number of bins, add it to the kwargs argument binning_params. For more details see _bin_statistics(). Defaults to False.

• rasterized (bool, optional) –

Rasterized option of matlplotlib.plot. Defaults to True.

• file_name (str, optional) – Name used to save the figure. The available output formats depend on the backend being used. Defaults to “”.

structure_factor.plotting.plot_estimation_imshow(k_norm, si, axis, file_name)[source]

Color level 2D plot, centered on zero.

Parameters
• k_norm (numpy.ndarray) – Wavenumbers.

• si (numpy.ndarray) – Scattering intensity corresponding to k_norm.

• axis (plt.Axes) – Axis on which to add the plot.

• file_name (str, optional) – Name used to save the figure. The available output formats depend on the backend being used. Defaults to “”.

structure_factor.plotting.plot_estimation_all(point_pattern, k_norm, estimation, exact_sf=None, error_bar=False, label='$\\widehat{S}$', rasterized=True, file_name='', window_res=None, scale='log', **binning_params)[source]

Construct 3 subplots: point pattern, associated scattering intensity plot, associated scattering intensity color level (only for 2D point processes).

Parameters
• point_pattern (PointPattern) – Object of type PointPattern containing a realization point_pattern.points of a point process, the window where the points were simulated point_pattern.window and (optionally) the intensity of the point process point_pattern.intensity.

• k_norm (numpy.ndarray) – Wavenumbers.

• estimation (numpy.ndarray) – Scattering intensity corresponding to k_norm.

• exact_sf (callable, optional) – Structure factor of the point process. Defaults to None.

• error_bar (bool, optional) – If True, k_norm and correspondingly estimation are divided into sub-intervals (bins). Over each bin, the mean and the standard deviation of estimation are derived and visualized on the plot. Note that each error bar corresponds to the mean +/- 3 standard deviation. To specify the number of bins, add it to the kwargs argument binning_params. For more details see _bin_statistics(). Defaults to False.

• rasterized (bool, optional) –

Rasterized option of matlplotlib.plot. Defaults to True.

• file_name (str, optional) – Name used to save the figure. The available output formats depend on the backend being used. Defaults to “”.

• window_res (AbstractSpatialWindow, optional) – New restriction window. It is useful when the sample of points is large, so for time and visualization purposes, it is better to restrict the plot of the point process to a smaller window. Defaults to None.

• scale (str, optional) –

Trigger between plot scales of matplotlib.plot. Defaults to log.

structure_factor.plotting.plot_sf_hankel_quadrature(k_norm, estimation, axis, scale, k_norm_min, exact_sf, color, error_bar, label, file_name, **binning_params)[source]

Plot the approximations of the structure factor (results of quadrature_estimator_isotropic()) with means and error bars over bins, see _bin_statistics().

Parameters
• k_norm (numpy.ndarray) – Vector of wavenumbers (i.e., norms of waves) on which the structure factor has been approximated.

• estimation (numpy.ndarray) – Approximation of the structure factor corresponding to k_norm.

• axis (plt.Axes) – Support axis of the plots.

• scale (str) –

Trigger between plot scales of matplotlib.plot.

• k_norm_min (float) – Estimated lower bound of the wavenumbers (only when estimation was approximated using Ogata quadrature).

• exact_sf (callable) – Theoretical structure factor of the point process.

• error_bar (bool) – If True, k_norm and correspondingly si are divided into sub-intervals (bins). Over each bin, the mean and the standard deviation of si are derived and visualized on the plot. Note that each error bar corresponds to the mean +/- 3 standard deviation. To specify the number of bins, add it to the kwargs argument binning_params. For more details see _bin_statistics(). Defaults to False.

• file_name (str) – Name used to save the figure. The available output formats depend on the backend being used.

• label (regexp) – Label of the plot.

Keyword Arguments

binning_params – (dict): Used when error_bar=True, by the method utils_bin_statistics() as keyword arguments (except "statistic") of scipy.stats.binned_statistic.