How to make a multiple line chart using matplotlib?

This recipe helps you make a multiple line chart using matplotlib

Recipe Objective

How to make a multiple line chart using matplotlib?

Step 1- Import Libraries.

import matplotlib.pyplot as plt import numpy as np

Step 2- Creating arrays.

x=np.array([2,5,7,9,10,33,64]) y=np.array([3,5,1,5,15,35,50]) a=np.array([14,17,19,25,18,30]) b=np.array([11,19,22,25,31,34])

Step 3- plotting the graph.

plt.plot(x,y) plt.plot(a,b)

What Users are saying..

profile image

Savvy Sahai

Data Science Intern, Capgemini
linkedin profile url

As a student looking to break into the field of data engineering and data science, one can get really confused as to which path to take. Very few ways to do it are Google, YouTube, etc. I was one of... Read More

Relevant Projects

Build an Intelligent AI Assistant with FastMCP and LangGraph
In this MCP project, you will learn to build a unified AI assistant that seamlessly integrates diverse development tools and services through the Model Context Protocol. This project demonstrates creating dynamic AI agents using FastMCP servers, LangGraph’s reasoning capabilities, and OpenAI models for intelligent, real-time interaction.

Topic modelling using Kmeans clustering to group customer reviews
In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

Build Deep Autoencoders Model for Anomaly Detection in Python
In this deep learning project , you will build and deploy a deep autoencoders model using Flask.

Loan Eligibility Prediction in Python using H2O.ai
In this loan prediction project you will build predictive models in Python using H2O.ai to predict if an applicant is able to repay the loan or not.

Build a Autoregressive and Moving Average Time Series Model
In this time series project, you will learn to build Autoregressive and Moving Average Time Series Models to forecast future readings, optimize performance, and harness the power of predictive analytics for sensor data.

Build a Collaborative Filtering Recommender System in Python
Use the Amazon Reviews/Ratings dataset of 2 Million records to build a recommender system using memory-based collaborative filtering in Python.

Credit Card Default Prediction using Machine learning techniques
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Build a Face Recognition System in Python using FaceNet
In this deep learning project, you will build your own face recognition system in Python using OpenCV and FaceNet by extracting features from an image of a person's face.

OpenCV Project to Master Advanced Computer Vision Concepts
In this OpenCV project, you will learn to implement advanced computer vision concepts and algorithms in OpenCV library using Python.

Expedia Hotel Recommendations Data Science Project
In this data science project, you will contextualize customer data and predict the likelihood a customer will stay at 100 different hotel groups.