freealg.visualization.plot_mass#
- freealg.visualization.plot_mass(sizes, x, rho, x0=None, rho0=None, atoms=None, ax=None, figsize=None, log_x=False, gap=0.7, save=False, latex=False)#
Plot mass of the absolutely continuous and atoms of spectral density.
- Parameters:
- sizesarray_like
A list of matrix decompression sizes. The length of this list should be the same as the number of rows of
rho.- xnumpy.array
The abscissa of density to compute its mass. The length of this array should be the same as the number of columns of
rho.- rhonumpy.ndarray
A 2D array where the row
rho[i, :]correspond to a density at the matrix sizesizes[i].- x0numpy.array, default=None
Abscissa, together with
rho0, used to compute mass at initial density at higher resolution grid. If None, onlyxandrhois used.- rho0numpy.array, default=None
A 1D density at initial time, used to compute higher accuracy initial density mass on the grid
x0. If None, the densityrho[0, :]is used. This is useful when the initial density has a spike-like behavior at the initial time (usually near the origin) hence a higher resolution grid is needed to accurately compute mass.- atomslist of tuples, default=None
A list of tuples
(atom_location, atom_weight).- axmatplotlib.axes._axes.Axes
matplotlib’s axis object. If None, new axis and figure is created.
- figsizetuple, default=None
Size of figure. If None, a default size is used.
- log_xbool, default=False
If True, the x axis is shown on base of powers of two times thousand, such as 1K, 2K, 4K, 8K, …, etc.
- gapfloat, default=0.7
The gap (from 0 to 1) as percentage between bar plots.
- savebool or str, default=False
If False, the plot is not saved. If True, the plot is saved with a default filename. If string, the plot is saved with the full-path filename and file extension given by the string.
- latexbool, default=False
If True, the plot is rendered using LaTeX.