statgis.statutils.plots#
Submodule for generate statistical plots
Module Contents#
Functions#
|
Calculate the pearson correlation matrix of the variables in a dataframe. |
- statgis.statutils.plots.plot_corr_matrix(data: pandas.DataFrame, variables: Union[numpy.typing.ArrayLike, None] = None, half: bool = False, hide_insignificant: bool = False, significant_threshold: float = 0.05, show_labels: bool = True, show_colorbar: bool = False, palette: str = 'Spectral', text_color: str = 'black', ax: Union[matplotlib.axes.Axes, None] = None) matplotlib.axes.Axes#
Calculate the pearson correlation matrix of the variables in a dataframe.
- Parameters:
data (pd.DataFrame) – Dataframe with the variables to evaluate their correlation.
variables (ArrayLike | None = None) – The variables of interest, if it is not defined, all variables in the dataframe will be evaluated.
half (bool (optional)) – If True, only show the correlation of the first half of the matrix, excluding the repeated correlation.
hide_insignificant (bool (optional)) – If True, hide all the correlation with a p-value greater than the significant threshold.
significant_threshold (float (optional)) – Threshold of significant correlation.
show_labels (bool (optional)) – Show the correlation value.
show_colorbar (bool (optional)) – Show color-bar
palette (str (optional)) – Color palette for correlation plot.
text_color (str (optional)) – Color of text correlation labels.
ax (matplotlib.axes.Axes | None (optional)) – Axes to draw the correlation matrix.
- Returns:
ax – Correlation matrix.
- Return type:
matplotlib.axes.Axes