Open links in new tab
  1. A box plot (or box-and-whisker plot) is a graphical representation of data that shows the distribution through their quartiles. It highlights the median, the first quartile (Q1), the third quartile (Q3), and potential outliers. Box plots are useful for comparing distributions between different datasets.

    Using Matplotlib

    The matplotlib.pyplot module provides a boxplot() function to create box plots. Here's a basic example:

    import matplotlib.pyplot as plt
    import numpy as np

    # Creating dataset
    np.random.seed(10)
    data = np.random.normal(100, 20, 200)

    # Creating plot
    plt.boxplot(data)

    # Show plot
    plt.show()
    Copied!

    This code generates a simple box plot for a dataset created using numpy.random.normal().

    Customizing Box Plots

    Matplotlib allows extensive customization of box plots. For example, you can create notched box plots, change the orientation, and customize colors and styles:

    Feedback
  2. Box Plot in Python using Matplotlib - GeeksforGeeks

    Jul 12, 2025 · The matplotlib.pyplot module of matplotlib library provides boxplot () function with the help of which we can create box plots. Syntax. The data values …

  3. Matplotlib - Box Plots - Online Tutorials Library

    We can create a box plot in Matplotlib using the boxplot() function. This function allows us to customize the appearance of the box plot, such as changing the whisker length, adding notches, and specifying the display of outliers.
    See more on tutorialspoint.com

    Code sample

    # Create an axes instance
    ax = fig.add_axes([0,0,1,1])
    # Create the boxplot
    bp = ax.boxplot(data_to_plot)
    plt.show()...
  4. Python Charts - Box Plots in Matplotlib

    Oct 21, 2024 · This article gives a short intro into creating box plots with Matplotlib. There are a lot of customizations you can do with the library, but we'll limit this …

  5. Python Boxplot Gallery | Dozens of examples with code

    A collection of boxplot examples made with Python, coming with explanation and reproducible code

  6. Python Matplotlib Boxplot: Create Box Whisker Plots - PyTutorial

    Dec 14, 2024 · Learn how to create effective box and whisker plots using Python Matplotlib plt.boxplot (). Master data visualization with examples, customization, and best practices.

  7. Python Boxplots: A Comprehensive Guide for Beginners

    Jul 17, 2024 · Learn to create and customize boxplots in Python. This comprehensive guide covers Matplotlib, and Seaborn, helping you visualize data …

  8. Python:Matplotlib | pyplot | .boxplot () | Codecademy

    Apr 27, 2023 · The matplotlib’s .boxplot() method is a powerful data visualization function in matplotlib’s pyplot module that creates box-and-whisker plots to …

  9. Box Plots in Python: A Matplotlib Guide - codepointtech.com

    Sep 1, 2025 · This comprehensive guide will walk you through everything you need to know to create stunning and informative box plots in Python using Matplotlib. We’ll cover the basics, customization …

  10. Boxplots — Matplotlib 3.10.8 documentation

    Visualizing boxplots with matplotlib. The following examples show off how to visualize boxplots with Matplotlib. There are many options to control their …