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 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 Create Colorplot of 2D Array MatplotlibThis tutorial explains how we can generate colorplot of 2D arrays using the matplotlib.pyplot.imshow() and matplotlib.pyplot.pcolormesh() methods in Python. 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. How to Use Error Bar in Python MatplotlibOne can plot data with error bars using the errorbar() function of Matplotlib in Python. How to Display Greek Letters in Python MatplotlibThis tutorial discusses how to show Greek letters with matplotlib in Python. How to Custom Colormap Using Python MatplotlibThis article discusses how we can create custom colormap using Matplotlib in Python. It will show two ways using ListedColormap class and the LinearSegmentedColormap class to create custom colormap using Matplotlib in Python. How to Plot Dates in MatplotlibThis article demonstrates how to work with matplotlib.dates and some basic examples using some dates with a built-in Python module. Then we will see an example using data from a CSV file to plot dates in Matplotlib. How to Create and Change Title Position in MatplotlibIn this tutorial, we explain the title() method that allows us to set a name to the plot as a label and see how to change the title position in Matplotlib. How to Plot 3D Line Plot in MatplotlibIn this demonstration, we demonstrate how to create a 3D plot in Matplotlib and see how to create a 3D plot with multiple colors in Matplotlib. How to Plot Waterfall Plot in Matplotlibin this tutorial, we explain to you how you can create a waterfall plot or chart with the help of python and the libraries we go to use the Matplotlib and waterfall_chart library for two dimensions and three dimensions waterfall plots. How to Plot Venn Diagram in MatplotlibIn this article, we'll discuss about how you can generate Venn diagrams with the help of Python and Matplotlib library. How to Plot Candlestick in MatplotlibIn this demonstration with us we introduce to a candlestick chart or plot and see how to create an open high low close candlestick chart with the help of the mplfinance module in python. How to Plot Contour in MatplotlibIn this demonstration we go to see what is contour plot and how we can obtain contour plots with the help of the contour() method in Matplotlib. How to Plot Horizontal Line in PythonThis tutorial demonstrates how to plot horizontal line in Python. How to Turn Off the Axes for Subplots in MatplotlibWe can turn off the axes for subplots in Matplotlib using set_axis_off(), axis() and set_visible() methods. How to Remove the Legend in MatplotlibWe could use get_legend().remove() and set_visible() methods to remove legend from a figure in Matplotlib. We can also remove legend from a figure in Matplotlib by setting legend to _nolegend_ in plot() method, axes.legend to None and figure.legends to empty list. How to Change Matplotlib Plot SizeWe use figure(), set_figheight() along with set_figwidth()and set_size_inches() methods and set rcParams to change plot size in Matplotlib. To change the format of figure, we can just change extension in savefig() method. How to Plot Data in Real Time Using MatplotlibWe can plot data in real using Matplotlib through FuncAnimation() function, canvas.draw() along with canvas_flush_events() and using plt.plot() in a loop. How to Automate Plot Updates in MatplotlibWe can automatically update plots in Matplotlib using various functions such as plot.draw(), canvas.draw() along with canvas_flush_events(), and clear_output(). How to Plot and Save a Graph in High Resolution in MatplotlibWe can control the resolution of the graph using various arguments of savefig() function while saving and figure() function while plotting in Matplotlib. How to Plot Logarithmic Axes in MatplotlibWe can plot logarithmic axes in Matplotlibusing set_yscale(), semilogy() and loglog() functions.