Box Plot in Matplotlib
A box plot, also known as a box-and-whisker plot, provides a visual summary of the distribution of a dataset. It represents key statistical measures such as the median, quartiles, and potential outliers in a concise and intuitive manner. Box plots are particularly useful for comparing distributions across different groups or identifying anomalies in the data.
# Import libraries
import matplotlib.pyplot as plt
import numpy as np
# Creating dataset
np.random.seed(10)
data = np.random.normal(100, 20, 200)
fig = plt.figure(figsize =(10, 7))
# Creating plot
plt.boxplot(data)
# show plot
plt.show()
Output
Matplotlib Tutorial
Matplotlib is easy to use and an amazing visualizing library in Python. It is built on NumPy arrays and designed to work with the broader SciPy stack and consists of several plots like line, bar, scatter, histogram, etc.
In this article, you’ll gain a comprehensive understanding of the diverse range of plots and charts supported by Matplotlib, empowering you to create compelling and informative visualizations for your data analysis tasks.
Table of Content
- Matplotlib Getting Started
- Creating Different Types of Plot
- Line Graph in Matplotlib
- Stem Plot in Matplotlib
- Bar chart in Matplotlib
- Plotting Histogram in Matplotlib
- Scatter Plot in Matplotlib
- Stack Plot in Matplotlib
- Box Plot in Matplotlib
- Pie Chart in Matplotlib
- Error Plot in Matplotlib
- Violin Plot in Matplotlib
- 3D Plots in Matplotlib