How to plot multiple values graph in matplotlib?

How to plot multiple values graph in matplotlib?

How to plot multiple values graph in matplotlib?

This recipe helps you plot multiple values graph in matplotlib


Recipe Objective

How to plot multiple values graph in matplotlib.

Step 1- Importing Libraries.

import matplotlib.pyplot as plt import numpy as np

Step 2- Creating multiple arrays

x=np.array([2,5,7,9,10,11,15,18,21,24,27,33,38,40,55,64]) y=np.array([5,1,9,5,10,13,19,15,21,24,28,35,41,45,50,71]) a=np.array([14,17,19,18,28,30,32,38,39]) b=np.array([11,19,22,25,31,34,40,47,48])

Step 3- Plotting the multiple values on same graph.

plt.scatter(x, y, label = "set-1", color='r') plt.scatter(a, b, label = "set-2", color='g') plt.xlabel('xaxis') plt.ylabel('yaxis') plt.legend()

Relevant Projects

Data Science Project on Wine Quality Prediction in R
In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Forecast Inventory demand using historical sales data in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Solving Multiple Classification use cases Using H2O
In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Loan Eligibility Prediction using Gradient Boosting Classifier
This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.

Learn to prepare data for your next machine learning project
Text data requires special preparation before you can start using it for any machine learning project.In this ML project, you will learn about applying Machine Learning models to create classifiers and learn how to make sense of textual data.

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.