Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Data Science
  • Data Science Projects
  • Data Analysis
  • Data Visualization
  • Machine Learning
  • ML Projects
  • Deep Learning
  • NLP
  • Computer Vision
  • Artificial Intelligence
Open In App
Next Article:
Understanding different Box Plot with visualization
Next article icon

Understanding different Box Plot with visualization

Last Updated : 14 Nov, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
Let's see how can boxplot be useful in different ways. Loading Libraries Python3 1==
import numpy as np import pandas as pd import matplotlib.pyplot as plt 
Preparing Data Python3 1==
spread = np.random.rand(50) * 100 center = np.ones(25) * 50 flier_high = np.random.rand(10) * 100 + 100 flier_low = np.random.rand(10) * -100 data = np.concatenate((spread, center, flier_high, flier_low), 0)  print (data) 
Output :
  [ 35.94741387  98.49500418  37.2487085   93.19618571   6.34263359    49.10532713  53.86860981  58.59362227  36.96325746  62.27757508    65.44118887  73.79592156  95.15399991  79.94114982  16.64273792    88.35737021  14.84581489   0.76759854  91.61486239  16.03299406    73.12589808   8.63636833  33.25606049  46.05712779  81.60993207    95.0390852   43.94169286   2.96961334  38.21446718  12.15763603     8.79716665  61.18542821  70.93695599  48.90136391  54.6233727    77.27315695  14.63597135  68.22763576  52.23548596  14.34491407    55.53669512  93.63144771  15.66242535  72.47360029  67.82493039     0.34568417  63.39884046   0.46750944  70.39370656  83.42420235    50.          50.          50.          50.          50.    50.          50.          50.          50.          50.    50.          50.          50.          50.          50.    50.          50.          50.          50.          50.    50.          50.          50.          50.          50.   134.61039367 133.42423423 132.77938791 157.75858139 105.99552891   159.1713425  190.9938417  118.33354777 142.13310114 113.54291724   -32.73427425 -34.92884623 -49.28116565 -15.24891626 -14.57460618    -9.48256045 -46.74250253 -36.3992666  -88.14980994 -64.49187441]
  Code #1: Normal Box Plot Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data)  plt.show() 
Output : Code #2: Notch Box Plot Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data, 1)  plt.show() 
Output : Code #3: Box Plot showing Outliers Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data, 0, 'gD')  plt.show() 
Output : Code #4: Box Plot without Outliers Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data, 0, '')  plt.show() 
Output : Code #5: Horizontal Box Plot Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data, 0, 'rs', 0)  plt.show() 
Output : Code #6: Horizontal Box Plot changing Whiskers length Python3 1==
plt.figure(figsize = (7, 5)) plt.boxplot(data, 0, 'rs', 0, 0.75)  plt.show() 
Output :

Next Article
Understanding different Box Plot with visualization

M

mohit gupta_omg :)
Improve
Article Tags :
  • Data Visualization
  • AI-ML-DS
  • AI-ML-DS With Python
  • Python Data Visualization

Similar Reads

    Box plot visualization with Pandas and Seaborn
    Box Plot is the visual representation of the depicting groups of numerical data through their quartiles. Boxplot is also used for detect the outlier in data set. It captures the summary of the data efficiently with a simple box and whiskers and allows us to compare easily across groups. Boxplot summ
    3 min read
    Getting started with Data Visualization in R
    Data visualization is the practice of representing data through visual elements like graphs, charts, and maps. It helps in understanding large datasets more easily, making it possible to identify patterns and trends that support better decision-making. R is a language designed for statistical analys
    5 min read
    Data Visualization Using Bqplot in Python
    Bqplot is a powerful and flexible tool for creating interactive visualizations within Jupyter Notebooks. Its integration with ipywidgets and use of D3.js make it a valuable library for data scientists and developers who need to build interactive data visualization applications. What is BqPlot in Pyt
    9 min read
    Python Bokeh tutorial - Interactive Data Visualization with Bokeh
    Python Bokeh is a Data Visualization library that provides interactive charts and plots. Bokeh renders its plots using HTML and JavaScript that uses modern web browsers for presenting elegant, concise construction of novel graphics with high-level interactivity.  Features of Bokeh: Flexibility: Boke
    15+ min read
    Data Visualization using Matplotlib in Python
    Matplotlib is a widely-used Python library used for creating static, animated and interactive data visualizations. It is built on the top of NumPy and it can easily handles large datasets for creating various types of plots such as line charts, bar charts, scatter plots, etc. These visualizations he
    10 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences