Skip to content
C

Problem 1: Create Two Subplots Side by Side

Easypython

Problem Description

Write a Python program that creates a figure with 2 subplots side by side: a line chart of monthly sales on the left, and a bar chart of subject scores on the right.

Input

Monthly sales data and subject score data.

Output

A displayed figure with both charts side by side.

Constraints

  • Use plt.subplots(1, 2).

Example Input

text
months=["Jan","Feb","Mar"], sales=[100,150,130] subjects=["Math","Science"], scores=[85,78]

Example Output

text
(A figure with a line chart on the left and a bar chart on the right)

Concepts Covered

plt.subplots(), individual axes plotting.

Input (stdin)

Output

Run your code to see output here...