

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Box plot with min, max, average and standard deviation in Matplotlib
To make a box plot for min, max, average and standard deviation in matplotlib,
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Create a random dataset of 5☓5 dimension.
- Find min, max, average and standard deviation from the data.
- Make a Pandas dataframe with Step 3, min, max, average and standard deviation data.
- Make a box plot from the dataframe column.
Example
import numpy as np import pandas as pd from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.randn(5, 5) min = data.min(0) max = data.max(0) avg = data.mean(0) std = data.std(0) df = pd.DataFrame(dict(min=min, max=max, avg=avg, std=std)) df.boxplot() plt.show()
Output
- Related Questions & Answers
- Plot mean and standard deviation in Matplotlib
- Average Returns and Standard Deviation of Securities
- Average of array excluding min max JavaScript
- Variance and Standard Deviation
- Python Pandas - Draw a bar plot and show standard deviation of observations with Seaborn
- Python Pandas - Draw a point plot and show standard deviation of observations with Seaborn
- max() and min() in Python
- Min-Max Heaps
- Perform min/max with MongoDB aggregation
- Use of min() and max() in Python
- Symmetric Min-Max Heaps
- PyTorch – How to normalize an image with mean and standard deviation?
- C++ Program to Calculate Standard Deviation
- What is Standard Deviation of Return?
- Java Program to Calculate Standard Deviation
Advertisements