- Matplotlib - Transforms
- Matplotlib - Working with Images
- Mathematical Expressions
- Matplotlib - Working With Text
- Matplotlib - 3D Surface plot
- Matplotlib - 3D Wireframe plot
- Matplotlib - 3D Contour Plot
- Three-dimensional Plotting
- Matplotlib - Violin Plot
- Matplotlib - Box Plot
- Matplotlib - Quiver Plot
- Matplotlib - Contour Plot
- Matplotlib - Scatter Plot
- Matplotlib - Pie Chart
- Matplotlib - Histogram
- Matplotlib - Bar Plot
- Matplotlib - Twin Axes
- Setting Ticks and Tick Labels
- Matplotlib - Setting Limits
- Matplotlib - Formatting Axes
- Matplotlib - Grids
- Matplotlib - Subplot2grid() Function
- Matplotlib - Subplots() Function
- Matplotlib - Multiplots
- Matplotlib - Axes Class
- Matplotlib - Figure Class
- Object-oriented Interface
- Matplotlib - PyLab module
- Matplotlib - Simple Plot
- Matplotlib - Pyplot API
- Matplotlib - Jupyter Notebook
- Matplotlib - Anaconda distribution
- Matplotlib - Environment Setup
- Matplotlib - Introduction
- Matplotlib - Home
Matplotlib Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Matplotpb - Box Plot
A box plot which is also known as a whisker plot displays a summary of a set of data containing the minimum, first quartile, median, third quartile, and maximum. In a box plot, we draw a box from the first quartile to the third quartile. A vertical pne goes through the box at the median. The whiskers go from each quartile to the minimum or maximum.
Let us create the data for the boxplots. We use the numpy.random.normal() function to create the fake data. It takes three arguments, mean and standard deviation of the normal distribution, and the number of values desired.
np.random.seed(10) collectn_1 = np.random.normal(100, 10, 200) collectn_2 = np.random.normal(80, 30, 200) collectn_3 = np.random.normal(90, 20, 200) collectn_4 = np.random.normal(70, 25, 200)
The pst of arrays that we created above is the only required input for creating the boxplot. Using the data_to_plot pne of code, we can create the boxplot with the following code −
fig = plt.figure() # Create an axes instance ax = fig.add_axes([0,0,1,1]) # Create the boxplot bp = ax.boxplot(data_to_plot) plt.show()
The above pne of code will generate the following output −
Advertisements