general_bar_plot#
General bar plot comparing multiple metrics for each category with consistent colors, hatching, and customizable font sizes.
π₯ Arguments#
Name |
Type |
Required |
Description |
|---|---|---|---|
df |
pd.DataFrame |
β |
DataFrame containing the category column and one or more metric columns. |
category_column |
str |
β |
Column name for the x-axis categories (e.g., βGroupβ, βConditionβ). |
figsize |
tuple |
β |
Figure size. Default: (12, 7). |
xlabel |
str |
β |
Label for x-axis. |
ylabel |
str |
β |
Label for y-axis. |
title |
str |
β |
Title of the plot. |
legend_loc |
str |
β |
Legend location. Default: βupper rightβ. |
bar_width |
float |
β |
Width of bars. Default: 0.25. |
color_map |
Dict[str, str] |
β |
Map from metric name to color. |
style_map |
Dict[str, str] |
β |
Map from metric name to hatch style. |
fontsize |
float |
β |
Base font size for axis labels, tick labels, title, legend, and annotations. Default: 12. |
save |
str |
β |
Base filename to save PNG and PDF. |
ax |
matplotlib.axes.Axes |
β |
Optional matplotlib Axes object. |
π¦ Example Output#
Click to show example code
# Example code for |general_bar_plot| not found.