๐Ÿ”ฅ
Exploratory Data Analysis (EDA)
WebsiteGithub
  • ๐Ÿ‘‹Welcome!
  • Course Content
    • 1. Introduction
      • EDA: Uncovering Insights and Patterns
      • Why EDA?
      • Importance of EDA
      • The role of EDA in the data analysis process
      • A Comprehensive Examination
      • Code & Practice
      • Basic Concept
    • 2. Fundamentals
      • Lifecycle
        • Data Science
        • EDA
    • 3. Dataset Selection and Understanding
      • Kaggle
      • Github
    • 4. Data Cleaning and Preprocessing
    • 5. Techniques and Approaches
      • Types of EDA
    • 6. Data Visualization
    • 7. Statistical Measures and Hypothesis Testing
    • 9. Case Studies
    • 11. Best Practices and Tips for Effective EDA
    • 12. Future Trends and Emerging Technologies
  • Dataset
    • โ„น๏ธKaggle
  • Tools and Software
    • โœจData Analysis Tools
    • ๐ŸPython Library
      • ๐ŸผPandas
      • ๐ŸงŠNumpy
      • ๐Ÿ“ŠMatplotlib
      • ๐Ÿ“ˆSeaborn
      • ๐Ÿ“ถPlotly
      • ๐ŸคนSciPy
      • ๐Ÿ’ซStatsmodels
      • ๐Ÿ‘‚Scikit-learn
      • ๐Ÿ—ณ๏ธYellowbrick
    • โ›๏ธPython tools
    • ยฎ๏ธยฎ ยฎ ยฎ The R Project
    • ๐ŸŒ€Data Exploration
    • ๐ŸŽฏData Quality
    • ๐Ÿ“”Data Profiling
    • ๐Ÿ“บVisualization
  • Tech Exploration
    • ๐ŸŽฌYoutube
    • โ˜๏ธGithub
    • ๐Ÿ”ฌLab
    • ๐Ÿ’ผCase Study
  • Reference
    • API Reference
      • Pets
      • Users
      • Quick Start
Powered by GitBook
On this page
  • Common techniques in EDA using Matplotlib:
  • Installation
  • Basic plots in Matplotlib
  1. Tools and Software
  2. Python Library

Matplotlib

A plotting library for creating visualizations

PreviousNumpyNextSeaborn

Last updated 1 year ago

๐Ÿ”— |

Matplotlib is a popular Python library for creating visualizations. It provides a wide range of functions and tools for creating various types of plots, charts, and graphs, making it an excellent choice for performing EDA. Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Matplotlib makes easy things easy and hard things possible.

  • Create .

  • Make that can zoom, pan, update.

  • Customize and .

  • Export to .

  • Embed in .

  • Use a rich array of built on Matplotlib.

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.

Common techniques in EDA using Matplotlib:

  1. Line Plots: Line plots are used to visualize the trend and patterns in data over time or any continuous variable. Matplotlib provides functions like plot() and show() to create and display line plots.

  2. Bar Plots: Bar plots are useful for displaying and comparing categorical data. Matplotlib's bar() and barh() functions allow you to create vertical and horizontal bar plots, respectively.

  3. Histograms: Histograms display the distribution of a numerical variable by dividing it into bins and showing the frequency of values within each bin. The hist() function in Matplotlib can be used to create histograms.

  4. Scatter Plots: Scatter plots are effective for visualizing the relationship between two numerical variables. Matplotlib's scatter() function can be used to create scatter plots, and you can add additional features such as colors, sizes, or labels to represent additional dimensions.

  5. Box Plots: Box plots, also known as box-and-whisker plots, summarize the distribution of a numerical variable, including its median, quartiles, and any outliers. Matplotlib's boxplot() function is commonly used to create box plots.

  6. Heatmaps: Heatmaps are useful for visualizing the correlation between variables in a dataset. Matplotlib's imshow() or pcolor() functions can be used to create heatmaps, and you can enhance them by adding color bars or annotations.

  7. Pie Charts: Pie charts are helpful for displaying the proportions of different categories in a dataset. Matplotlib's pie() function can be used to create pie charts, and you can customize the colors, labels, and other properties as needed.

These are just a few examples of the wide range of visualizations you can create using Matplotlib for EDA. Matplotlib provides extensive customization options, allowing you to create visually appealing and informative plots to explore and understand your data effectively.

Installation

Windows, Linux and macOS distributions have matplotlib and most of its dependencies as wheel packages. Run the following command to install matplotlib package :

python -mpip install -U matplotlib

Basic plots in Matplotlib

Matplotlib comes with a wide variety of plots. Plots helps to understand trends, patterns, and to make correlations. Theyโ€™re typically instruments for reasoning about quantitative information. Some of the sample plots are covered here.

# importing matplotlib module
from matplotlib import pyplot as plt
 
# x-axis values
x = [5, 2, 9, 4, 7]
 
# Y-axis values
y = [10, 5, 8, 4, 2]
 
# Function to plot
plt.plot(x,y)
 
# function to show the plot
plt.show()

Output

Output

๐Ÿ
๐Ÿ“Š
GitHub
Website
publication quality plots
interactive figures
visual style
layout
many file formats
JupyterLab and Graphical User Interfaces
third-party packages
Visitors