Home » Python » Python Data Visualization

# Notched Box Plot in Python using Matplotlib

Here, we are going to learn about the **notched box plot in python using matplotlib and its Python implementation**.

Submitted by Anuj Singh, on August 10, 2020

Making a box plot or whisker plot for each column of x (if x is a matrix) or vector x includes creating a box that extends from the lower quartile to upper quartile values of data. It also has a line right at the median of the datapoint (each column of the matrix in the case of the matrix). It also includes outliers as fliers points and is represented by dots. In this way, it helps in visualizing the definitive range of data and therefore it is important to get to know about how we can plot BoxPlot in python. There is a subtype of boxplot in which edges in the middle of the box are bent inside. Such a box plot is called the Notched Box plot. Matplot has an inbuilt defined function with a command notch for Box-Plot i.e. **matplotlib.pyplot.boxplot()**.

The following example illustrates the basic example of the Box Plot.

## Python code for notched box plot using matplotlib

import numpy as np import matplotlib.pyplot as plt # Generating Data spread = np.random.rand(65) * 82 center = np.ones(36) * 50 flier_high = np.random.rand(12) * 100 + 100 flier_low = np.random.rand(10) * -100 data = np.concatenate((spread, center, flier_high, flier_low)) plt.figure() plt.title('Notched Box Plot') plt.boxplot(data, notch=True) plt.ylabel('Variation')

**Output:**

Output is as Figure

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.