How to make a color graph using matplotlib?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

How to make a color graph using matplotlib?

How to make a color graph using matplotlib?

This recipe helps you make a color graph using matplotlib

0

Recipe Objective

How to make a color graph using matplotlib?

Step 1 - Importing Libraries.

import matplotlib.pyplot as plt import numpy as np

Step 2 - Creating two different sets of Array.

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([2,6,9,11,14,17,19,18,22,29,28,30,32,38,39,63,67,89]) b=np.array([6,9,1,11,17,19,22,25,31,34,40,47,48,55,76,81,90,91])

Step 3 - We will plot the Bar Graphs for two different sets of the array by assigning two different colors two them.

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

Relevant Projects

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.

Human Activity Recognition Using Smartphones Data Set
In this deep learning project, you will build a classification system where to precisely identify human fitness activities.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

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 Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Data Science Project-TalkingData AdTracking Fraud Detection
Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

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.

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

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.