beautifulplots.barplot
Module Contents
Functions
|
Bar plot function designed for ease of use and aesthetics. |
- beautifulplots.barplot.barplot(df, bar_columns, bar_values, barcurrency=None, barorientation='v', bardataformat='1.2f', y2=None, estimator=sum, estimator2=sum, ax=None, bardatalabels=False, test_mode=False, bardatafontsize=14, **kwargs)[source]
Bar plot function designed for ease of use and aesthetics. The underlying barplot is ased on the Seaborn with additions, such as secondary axis, data labels, and improved default parameters. Refer to beautifulplots plot_defaults for a complete list of options.
- Parameters
df (DataFrame) – The input DataFrame containing colums corresponding to bar_plot values (“bar_values”) and column names (see examples in documentation)
bar_columns – Datafrae columns corresponding to bar column names
bar_values – Dataframe column corresponding to bar column values
ax (axis) – matplotlib axis (optional), default = None. If axis is None, then create a matplolib figure, axis to host the barplot
color – Matplotlib compatabile color name as text or RGB values, for example, color = [51/235,125/235,183/235].
palette – Matplotlib compatible color palette name, for example, “tab20”
hue – Name of hue dimension variable (i.e., DataFrame column name)
ci – Seaborn confidence interval parameter: float, sd, or None, default = None
barorientation – default = v (vertical), or h (horizontal)
barcurrency – default = False (bar values do not represent currency). True (bar values represent currency, append $ to the value)
bardatalabels (Boolean) – default = False (data labels not included)
estimater – default = sum. Specifies how to aggregate plot bar data.
estimator2 – default = None. Summarize y2 asis daa. Default is no aggregation, do not summarize y2 axis data.
options (additional) – see beautifulplot.plot_defaults for additional input variables.
- Returns
returns True if processing completes succesfully (without errors).