On this page
article
Plot with Matplotlib
Create a line chart from data.
Category: matplotlib
Problem
Create a line chart from data.
Solution
plt.plot(dates, values)
plt.title('Sales')
plt.savefig('chart.png')
Notes
- Adapt variable names and paths to your project
- Add error handling for production use
- See related chapters in the Learning Path