Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Create a Simple Line Chart | Basics: Line Charts
Visualization in Python with matplotlib
course content

Зміст курсу

Visualization in Python with matplotlib

Visualization in Python with matplotlib

1. Basics: Line Charts
2. Bar Charts
3. Scatter Plots

Create a Simple Line Chart

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Disclaimer: FREE DATA FROM WORLD BANK VIA GAPMINDER.ORG, CC-BY LICENSE.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 3
toggle bottom row

Create a Simple Line Chart

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Disclaimer: FREE DATA FROM WORLD BANK VIA GAPMINDER.ORG, CC-BY LICENSE.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 3
toggle bottom row

Create a Simple Line Chart

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Disclaimer: FREE DATA FROM WORLD BANK VIA GAPMINDER.ORG, CC-BY LICENSE.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Завдання

Build a line chart representing the level of CO2 emissions (metric tonnes of CO2 per person) for the US. Follow the next steps:

  1. Import the matplotlib.pyplot under the plt alias.
  2. Save the United States data in the usa variable.
  3. Create Figure and Axes objects using the .subplots() method of plt and assign them to variables fig, and ax, respectively.
  4. Initialize a line chart:
    • display years on the x-axis (use the .index attribute), convert them to integers (int);
    • display level of emissions on the y-axis (use the .values attribute).
  5. Display the plot.

Once you've completed this task, click the button below the code to check your solution.

Disclaimer: FREE DATA FROM WORLD BANK VIA GAPMINDER.ORG, CC-BY LICENSE.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 3
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt