Plotting
This module contains functions for plotting general statistics.
plotting
Functions:
-
plot_grouped_corr_heatmap–Plot a correlation heatmap with grouped variable labels.
plot_grouped_corr_heatmap
plot_grouped_corr_heatmap(data: DataFrame, subplot_kwargs: Dict = {}, heatmap_kwargs: Dict = {}, axis_labels: str = None, grouping_linewidth: float = 2, ax: Axes = None, **kwargs: Any) -> Axes
Plot a correlation heatmap with grouped variable labels.
Parameters:
-
(dataDataFrame) –DataFrame with variables named in the format "group_variable".
-
(subplot_kwargsDict, default:{}) –Keyword arguments to pass to
plt.subplots(). Defaults to{}. -
(heatmap_kwargsDict, default:{}) –Keyword arguments to pass to
sns.heatmap(). Defaults to{}. -
(axis_labelsstr, default:None) –Label for the x and y axes. Defaults to
None. -
(grouping_linewidthfloat, default:2) –Width of the lines separating variable groups. Defaults to
2. -
(axAxes, default:None) –Axes to plot on. Defaults to
None.
Returns:
-
Axes–plt.Axes: The created axes.
Example
ax = plot_grouped_corr_heatmap(data)
plt.savefig('../correlation_matrix.png', dpi=300)
Source code in stats_utils/stats/plotting.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |