# Matplotlib for Data Visualization python

__Introduction__

Want to learn __Data Visualization using Matplotlib?__

Hello friends, in the previous blog post we have to see basic pandas library Numpy and pandas so it’s time to see Data viasualization in python using Matplotlib. so first upon what is matplotlib ? let’s start. Matplotlib is the grandfathers library of data visualizations with Python. It was created by the John Hunter. He created it to try to replicate MatLab(another programming language) plotting capabilities in Pythons. So if you happen to be familiar with matlab, matplotlibs will feel natural to you.

fig 01)Matplotlib for Data Visualization python |

- Generally easy to started for simple plot
- Support for custom labels and text
- Great control of every element in a figures
- High-quality output in many formats
- Very customizable in general

## Installation

`conda install matplotlib`

**5.1 example:**

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

# plot a lines, implicitly creating a subplot(111)

plt.plot([1,2,3])

# now create a subplots which represents the top plot of a grid with 2 rows and 1 column.

#Since this subplots will overlap the first, the plot (and its axes) previously

created, will be removed

plt.subplot(211)

plt.plot(range(12))

plt.subplot(212, facecolor=’y’) # create 2nd subplots with yellow background

plt.plot(range(12))

**5.2 Example:**

from matplotlib import pyplot as plt

import numpy as np

fig,ax = plt.subplots(1,1)

a = np.array([22,87,5,43,56,73,55,54,11,20,51,5,79,31,27])

ax.hist(a, bins = [0,25,50,75,100])

ax.set_title(“histogram of result”)

ax.set_xticks([0,25,50,75,100])

ax.set_xlabel(‘marks’)

ax.set_ylabel(‘no. of students’)

plt.show()

Summary :

In this article we saw data visualization with matplotlib using python from zero to hero so about this section you have any problem then free to ask me

BEST OF LUCK !!!

### sachin Pagar

I am Mr. Sachin pagar Embedded system engineer, the founder of Pythonslearning, a Passionate Educational Blogger and Author, who love to share the informative content on educational resources.

## 4 comments on “data visualization with matplotlib using python from zero to hero”

## Anonymous

May 8, 2020 at 3:14 amNice

[…] in python for Data Visualization Tutorial? Hello everyone, I’m already post the blog of Data Visualization for Matplotlib so it’s time to see second part of the post Data Visualization with Seaborn liabrary. […]

[…] worry you can directly the open through following link: 1. Numpy 2. Pandas 3. Matplotlib 4. Seaborn 5. Pandas Built in Data Visualization (Note= If you want to cover more topic in […]

[…] Also read : python matplotlib […]