How are you?
This is my first time posting here, so if the post format is not good, I apologize and ask for guidance. I wrote the questions and uploaded the images to show the problem. If it is difficult to see them, please tell me.
I have a very beginner doubt, could anyone help me?
I’m trying to plot a stacked barchart from a pivot table.
I have a wine sales database with daily data.
Then I did a pivot table to aggregate data from daily to yearly, this way:
I want to plot a stacked barchart from this pivot table, so the x-axis is the year, and the y-axis is the amount of sales by country. And I want the colors classified by country. If possible, I want to add my own colors.
The I did this. The y-axis didn’t accept y=‘country’ - the message error was ‘The dataframe contains no ‘country’.’. Then I added y=[‘Argentina’], and it worked somehow, plotting a stacked barchart.
But then, the colors are the pattern, I cannot change them.
I wonder if there is a better way to plot aggregated data. Is the pivot_table a bad choice to be plotted later?
If it is possible to plot from this pivot table, how to do it correctly and in a way I can change other features like color, template and so on?