Course Content
Visualization in Python with matplotlib
Visualization in Python with matplotlib
Create a Stacked Bar Chart
Swipe to show code editor
You are given the same dataframe data
. Your tasks are:
- Save data for
'MADURAI'
in themadurai
variable. - Call
.bar()
function twice:Use
'New Delhi'
and'Madurai'
as thelabel
parameters.- the first time to build bars for the
new_delhi
data (the'Month'
column on the x-axis and the'Rainfall'
column on the y-axis); - the second time to build bars for the
madurai
data above built ones (the same columns and order as for thenew_delhi
data).
- the first time to build bars for the
- Display the legend of the plot.
Thanks for your feedback!
Create a Stacked Bar Chart
Swipe to show code editor
You are given the same dataframe data
. Your tasks are:
- Save data for
'MADURAI'
in themadurai
variable. - Call
.bar()
function twice:Use
'New Delhi'
and'Madurai'
as thelabel
parameters.- the first time to build bars for the
new_delhi
data (the'Month'
column on the x-axis and the'Rainfall'
column on the y-axis); - the second time to build bars for the
madurai
data above built ones (the same columns and order as for thenew_delhi
data).
- the first time to build bars for the
- Display the legend of the plot.
Thanks for your feedback!
Create a Stacked Bar Chart
Swipe to show code editor
You are given the same dataframe data
. Your tasks are:
- Save data for
'MADURAI'
in themadurai
variable. - Call
.bar()
function twice:Use
'New Delhi'
and'Madurai'
as thelabel
parameters.- the first time to build bars for the
new_delhi
data (the'Month'
column on the x-axis and the'Rainfall'
column on the y-axis); - the second time to build bars for the
madurai
data above built ones (the same columns and order as for thenew_delhi
data).
- the first time to build bars for the
- Display the legend of the plot.
Thanks for your feedback!
Swipe to show code editor
You are given the same dataframe data
. Your tasks are:
- Save data for
'MADURAI'
in themadurai
variable. - Call
.bar()
function twice:Use
'New Delhi'
and'Madurai'
as thelabel
parameters.- the first time to build bars for the
new_delhi
data (the'Month'
column on the x-axis and the'Rainfall'
column on the y-axis); - the second time to build bars for the
madurai
data above built ones (the same columns and order as for thenew_delhi
data).
- the first time to build bars for the
- Display the legend of the plot.