This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stacked_bar_chart(pivoted_df, stack_vals, level_values_field, chart_title, x_label, y_label, filename, color1, color2): | |
# | |
# stacked_bar_chart: draws and saves a barchart figure to filename | |
# | |
# pivoted_df: dataframe which has been pivoted so columns correspond to the values to be plotted | |
# stack_vals: the column names in pivoted_df to plot | |
# level_values_field: column in the dataframe which has the values to be plotted along the x axis (typically time dimension) | |
# chart_title: how to title chart | |
# x_label: label for x axis | |
# y_label: label for y axis |