aigct.plot_util
Functions
|
|
|
|
|
|
|
Plot a heatmap using seaborn. |
Module Contents
- aigct.plot_util.barchart(df: pandas.DataFrame, x: str, y: str, x_label: str = '', y_label: str = '', ci: pandas.DataFrame = None, filename: str = None, hatch: str = None, edgecolor=None, palette=None, errorbar=None, estimator: str = 'mean', title: str = '', title_fontsize: int = 20, y_label_fontsize: int = 15, x_label_fontsize: int = 15, y_tick_label_size: int = 15, x_tick_label_size: int = 15, xtick_rotation: int = None, xtick_rotation_mode: str = None, file_dpi: int = 300, bbox_inches: str = 'tight')[source]
- aigct.plot_util.heatmap(df: pandas.DataFrame, y_column: str = None, x_column: str = None, value_column: str = None, x_label: str = '', y_label: str = '', title: str = '', cmap: str = 'viridis', annot: bool = True, fmt: str = '.2f', linewidths: float = 0.5, title_fontsize: int = 20, label_fontsize: int = 15, tick_fontsize: int = 12, annot_fontsize: int = 10, figsize: tuple = (10, 8), filename: str = None, vmin: float = None, vmax: float = None, cbar: bool = True, cbar_kws: dict = None, square: bool = False, mask: pandas.DataFrame = None, file_dpi: int = 300, bbox_inches: str = 'tight')[source]
Plot a heatmap using seaborn.
Parameters
- dfpd.DataFrame
DataFrame to plot as heatmap
- y_columnstr, optional
Column to use for y-axis categories. If provided along with x_column and value_column, the function will pivot the data before plotting.
- x_columnstr, optional
Column to use for x-axis categories. If provided along with y_column and value_column, the function will pivot the data before plotting.
- value_columnstr, optional
Column containing values to plot. If provided along with x_column and y_column, the function will pivot the data before plotting.
- x_labelstr, optional
Label for x-axis
- y_labelstr, optional
Label for y-axis
- titlestr, optional
Title of the plot
- cmapstr, optional
Colormap to use
- annotbool, optional
Whether to annotate cells with values
- fmtstr, optional
Format string for annotations
- linewidthsfloat, optional
Width of lines between cells
- title_fontsizeint, optional
Font size for title
- label_fontsizeint, optional
Font size for axis labels
- tick_fontsizeint, optional
Font size for tick labels
- annot_fontsizeint, optional
Font size for annotations
- figsizetuple, optional
Figure size (width, height) in inches
- filenamestr, optional
If provided, save figure to this file
- vminfloat, optional
Minimum value for colormap scaling
- vmaxfloat, optional
Maximum value for colormap scaling
- cbarbool, optional
Whether to draw a colorbar
- cbar_kwsdict, optional
Additional arguments for colorbar
- squarebool, optional
Whether to make cells square-shaped
- maskpd.DataFrame, optional
Boolean DataFrame of same shape as df, True values will not be plotted
- file_dpiint, optional
DPI for saved figure
- bbox_inchesstr, optional
Bounding box in inches for saved figure
Returns
- matplotlib.axes.Axes
The matplotlib axes containing the plot