Practical solutions

Python Matplotlib Howto's How-To Guides

Solve the problem. Keep building. Collection of Python Matplotlib how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Create Multiple Subplots Using MatplotlibIn this tutorial, we will tackle how you can work with the subplot functionality provided with the Matplotlib package to create and display multiple plots in one figure in Python. How to Create Colored Triangle in Matplotlibin this tutorial we will use Python Matplotlib to draw ourselves a colored triangle and see how to create it with the help of the turtle library in Matplotlib. How to Create Circle Arrow in MatplotlibIn this tutorial we use Python with Matplotlib to draw a circle arrow from scratch with the help of the turtle library. How to Annotate in MatplotlibIn this article we'll look at how to add an annotation to the plot and see the syntax of annotate() method and how it works with Matplotlib in Python. Matplotlib Marker FillIn this explanation we have a look at how to customize marker style and create a filled marker and we also have a look at how to create a plot with different line styles in Matplotlib. How to Set Width Parameter of Bar Graph in MatplotlibIn this demonstration about Matplotlib, we discuss bar graphs and we have a look at the width parameter of the bar function in Matplotlib. How to Create Animation in Matplotlib This article explains the steps in creating an animated chart in Python using the Matplotlib package. To understand the steps involved, one should have minimal knowledge of the Matplotlib library. Matplotlib RetinaIn this article we will explain all about the Matplotlib retina. One of the Matplotlib key features is its support for retina displays, which are screens with a high pixel density. This makes Matplotlib figures look extremely sharp and clear, even on displays with a high resolution. How to Create Stackplot in MatplotlibThis post concentrates on explaining the different steps that are involved in creating a %matplotlib notebook graph in Python using the matplotlib package. Stackplot is a function in matplotlib that allows you to plot multiple data sets on top of each other. Matplotlib TriangulationThis post will help you to understand the Matplotlib triangulation. How to Make a Square Plot With Equal Axes in MatplotlibWe can use set_aspect() method and axis() method to make a square plot with equal axes in Matplotlib. How to Show Pyplot Grid in MatplotlibIt demonstrates how to draw a grid on a plot in Python Matplotlib. Uses grid() function to draw a grid and explains how to change grid color and line type. How to Specify the Legend Position in Graph Coordinates in MatplotlibThis article shows you how to specify the legend's position in a graph in Matplotlib. How to Plot a Table in MatplotlibThis article teaches you how to plot a table in Matplotlib using the matplotlib.pyplot.table() method. How to Display an Image in Grayscale in MatplotlibThis article introduces how to display a grayscale image in Matplotlib. How to Plot Histogram for List of Data in MatplotlibThis tutorial shows how we can use the plt.hist() method to plot histograms from a list of data. We can use the plt.hist() method to plot histograms from a list of data. How to Set Color for Scatterplot in MatplotlibIt demonstrates how you set color for scatter plot using the c parameter in matplotlib.pyplot.scatter() method. How to Draw an Arbitrary Line in MatplotlibThis tutorial explains how we can draw arbitrary lines in Matplotlib using the matplotlib.pyplot.plot(), matplotlib.pyplot.vlines(), matplotlib.pyplot.hlines() methods and matplotlib.collections.LineCollection. How to Add Subplot to a Figure in MatplotlibThis tutorial explains how we can add subplots to a Matplotlib figure using the Matplotlib.figure.Figure.add_subplot() method in Python. How to Create Density Plot in MatplotlibTo generate a density plot using Python, we at first estimate the density function from the given data using the gaussian_kde() method from the scipy.stats module and then plot the density function to generate the density plot. How to Set Number of Ticks in MatplotlibThis tutorial explains how we can set number of ticks in a Matplotlib figure using the Matplotlib.ticker.MaxNLocator class and set_ticks() method. How to Read Images using imread in Python MatplotlibThe article explains how we can read images from a file into an array using the imread() method from the Matplotlib package. How to Plot Smooth Curve in MatplotlibThis tutorial explains how we can plot a smooth curve from given coordinates using the modules from the scipy and matplotlib package. How to Plot Multiple Lines in Python MatplotlibThis tutorial explains how we can plot multiple lines in Python Matplotlib and set a different color for each line in the figure.