Correct the mistakes

Report a typo

You've decided to plot the number of countries in Europe and Asia that you've visited from 2018 to 2021. You want to get a graph like this:

Correct the code by observing the stacked area chart

Here's your code:

years = range(2018, 2022)
europe = [8, 9, 3, 1]
asia = [3, 2, 0, 0]

plt.stackplot(europe, asia, years, labels=["European countries", "Asian countries"])

plt.title("Countries visited per year")
plt.xlabel("Years")
plt.ylabel("Number of countries")

plt.xticks(years)
plt.yticks(range(0, 16, 5))

Which mistakes do you need to correct to get the graph above?

Select one or more options from the list
___

Create a free account to access the full topic