1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python for Finance

Connected

Exercise

Multiple lines on the same plot

You can also plot multiple datasets as different lines. To do so, you can use the plot() function multiple times. Let's plot the stocks of two companies over time.

matplotlib.pyplot is imported as plt and lists days, prices1, and prices2 are available in your workspace.

Instructions

100 XP

Plot prices1 data with a red line, and prices2 data with a green line.