Python PyPlot

Python Tutorial @ Home
Introduction
Matplotlib and numpy
Installing NumPy and Matplotlib
Types of visualization
Baisc Visualization rules
Line plot / chart

Data visualization using pyplot

Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. It was introduced by John Hunter in the year 2002.

One of the greatest benefits of visualization is that it allows us visual access to huge amounts of data in easily digestible visuals. Matplotlib consists of several plots like line, bar, scatter, histogram etc.

Matplotlib

One of the most popular uses for Python in data analysis. Naturally, data scientists want a way to visualize their data. Either they are wanting to see it for themselves to get a better grasp of the data, or they want to display the data to convey their results to someone. With Matplotlib, arguably the most popular graphing and data visualization module for Python, this is very simplistic to do.

In order to get the Matplotlib, you should first head to Matplotlib.org and download the version that matches your version of Python.

Numpy

Another library that helps in the process of plotting graphs/charts using pyplot in NumPy. NumPy stands for numerical python. NumPy is the core library for scientific computing in python. It provides a high-performance multidimensional array object and tools for working with these arrays.

Using NumPy, a developer can perform the following operations:

• Mathematical and logical operations on the array.
• Transforms and routines for shape manipulation.
• Operations related to linear algebra. NumPy has inbuilt functions for linear algebra and random number generation.

Installing NumPy

We can install NumPy using the popular python package installer pip. The command to install NumPy is as follows
pip install NumPy

NumPy will get installed onto your system and will be ready to use.

Installing matplotlib

Before we start plotting graphs in matplotlib , it needs to be installed. for the installation of Matplotlib we have to follow the following steps:

Step 1:
open cmd (command prompt) and run command prompt as an administrator

Setp:2
Move to the python folder (where python has been installed)

Step:3
use the following command to install Matplotlib
pip install matplotlib

Step:4
the installation process of Matplotlib will start in our system.

After the successful installation of the Library package (Matplotlib), we can plot various types of graphs in the python shell using pyplot methods.

Python Basic Programming Tutorial

Python Introduction     Getting started in Python Programming      Python propgramming fundamentals     Python Operators    Python If Condition     Python for loop    Python range construct      Python While loop    break and continue statements     Different looping techniques     Python List     Python String     Python Functions    Python Inbuilt Functions     Python Recursion     Using Python Library     Python Tuples     Python Dictionary     Python Sets     Python Strings     Python Exception Handling     Python Data File Handling