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 Reverse Axes in MatplotlibWe can revert axes in Matplotlib using invert_xaxis() or invert_yaxis() methods for axes objects and axis() and xlim() or ylim() methods for pyplot objects. How to Set Limits for Axes in MatplotlibWe can set limits for axes in Matplotlib using xlim() or ylim(), set_xlim() or set_ylim() and axis() methods. How to Plot Time Series in MatplotlibThis article teaches you how to plot a time series in Matplotlib using the matplotlib.pyplot.plot_date() and matplotlib.pyplot.plot_date() methods. 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. 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 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 MatplotlibDraw finite line segments in Matplotlib with plot(), hlines(), vlines(), and 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 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 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. How to Plot CDF Matplotlib PythonThis tutorial explains how we can generate plot of CDF using the Matplotlib in Python. How to Label Scatter Points in MatplotlibTo label the scatter plot points in Matplotlib, we can use the matplotlib.pyplot.annotate() function which adds a string at the specified position. Similarly, we can also use the matplotlib.pyplot.text() function to add the text labels to points in the scatterplot. How to Create Reverse Colormap in Python MatplotlibThis tutorial explains the ways to reverse the colormap of a Python Matplotlib Plot. How to Draw Vertical Lines on a Plot MatplotlibLearn how to draw Vertical Lines on a plot generated using Matplotlib in Python How to Add Value Labels on Matplotlib Bar ChartThis article discusses how we can add value labels on matplotlib bar chart. We have discussed two ways using pyplot.text() and pyplot.annotate() methods to add value labels on matplotlib bar chart.