# 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 !!!

Nice

Pingback: data visualisation using seaborn in python advanced functionality step by step | Pythonslearning

Pingback: data science with python tutorial for beginners | Pythonslearning

Pingback: Decorators in Python Tutorials point | Pythonslearning