Posts

Showing posts with the label Data Science

How to generate Bar Graph using Matplotlib Library

Image
Bar chart is a special type of graph in which numerical values of some data are represented by rectangular bars of equal widths among some discrete set of items to which it varies its length.  This type of charts has a discrete range of data which helps in providing visual representation of categorical data. In this tutorial post, we will discuss here about how to generate Bar plots and customize it using Matplotlib python library. And for that purpose, we will demonstrate example of plotting data of visitor’s population entering a museum during different years. For using Matplotlib library for plotting, you must first have to import Matplotlib library and use functions provided by this awesome library. Also, you will use inline magic function %matplotlib inline so that you may display resultant figure after every line of code In[1]: import matplotlib.pyplot as plt %matplotlib inline Now you will define data of populations and years with variable nam...

Introduction to Matplotlib Library for Data Visualization

Image
Data Visualization is one of the most important tasks in data analysis to explore and communicate our data. It is so broad field that many books have been written so far by great publishers which you can find on book stores. In this article, we will try to introduce  Matplotlib  library which is widely used for data visualization in python as data science toolkit to create quality plots ready for publications. Matplotlib  is generally a two-dimensional (2D) MATLAB style plotting library of python, created by John D. Hunter in 2002. Since then, John D. Hunter also cooperated with Fernando Perez (Creator of IPython) and others to make IPython work with this Matplotlib library for scientific computing. This cross-platform supported library is built on NumPy library designed to work with SciPy stack library for scientific computations.  This library first commercially released on 2003 can be used in Python and IPython shells, Python scripts, Jupiter no...