c2v.pl.barplot

Contents

c2v.pl.barplot#

c2v.pl.barplot(data, kind='v', ax=None, cmap='Reds', vmax=None, vmin=0.0, return_fig=False, show=True, title=None, right_spines=None, left_spines=None, top_spines=None, bottom_spines=None, width=0.8, figsize=None, edgecolor='black', rotation=None, arrow=None, **kwargs)#

Draws barplot colored by the value in each bar.

Parameters:
data pd.Series

Data to plot.

kind Literal["h", "v"], optional

Kind of plot. Default is “v”.

ax plt.Axes | None, optional

Axes object to draw on. Default is None.

cmap str, optional

Colormap to use. Default is “Reds”.

vmax float | None, optional

Maximum value for colormap normalization. Default is None.

vmin float | None, optional

Minimum value for colormap normalization. Default is 0.

return_fig bool, optional

Whether to return the figure object. Default is False.

title str | None, optional

Title for the plot. Default is None.

right_spines bool | None, optional

Whether to show right spines. Default is None.

left_spines bool | None, optional

Whether to show left spines. Default is None.

top_spines bool | None, optional

Whether to show top spines. Default is None.

bottom_spines bool | None, optional

Whether to show bottom spines. Default is None.

width float, optional

Width of the bars. Default is 0.8.

figsize tuple[float, float] | None, optional

Figure size. Default is None.

edgecolor str, optional

Edge color of the bars. Default is “black”.

rotation float | None, optional

Rotation angle for labels, if None rotation depends on the . Default is None.

arrow list[Literal["right-bottom", "top-left"]] | Literal["right-bottom", "top-left"] | None, optional

Whether to add arrow to the plot. Default is None.

**kwargs

Additional keyword arguments for ax.bar().

show bool

Return type:

Figure | None

Returns:

fig : plt.Figure | None Figure object if return_fig is True, otherwise None.