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 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 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 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 a 2D Heatmap With MatplotlibWe can plot a 2D heatmap using imshow() function,seaborn library and pcolormesh() function. How to Hide Axis Text Ticks and/or Tick Labels in MatplotlibDifferent methods could hide axis text ticks and/or tick labels in Matplotlib like xaxis.set_visible(False), xaxis.set_ticks([]), xaxis.set_ticklabels([]), and setting the ticks color to be white. How to Draw Rectangle on Image in MatplotlibThis how-to article introduces how to draw rectangle on image in Matplotlib. Rectangle patch should be added to the plot by add_patch method to draw the rectangle on image in Matplotlib How to Create Different Subplot Sizes in MatplotlibThis how-to article introduces how to create different subplots size in Matplotlib. %matplotlib NotebookThis post concentrates on explaining the different steps that are involved in creating a %matplotlib notebook graph in Python using the Matplotlib package. So, all detail about the %matplotlib notebook is available in this blog. twinx and twiny in MatplotlibThis tutorial explains how we can create twin axes in Matplotlib with common X-axis or Y-axis using matplotlib.axes.Axes.twinx() and matplotlib.axes.Axes.twiny() in Python. Matplotlib.pyplot.specgram() in PythonThis tutorial explains how we can plot spectrograms in Python using the matplotlib.pyplot.specgram() and scipy.signal.spectrogram() methods. Matplotlib 3D ProjectionThis tutorial explains how we can create 3d plots using the Matplotlib using the mplot3d package from the mpl_toolkits library. Color Cycle in MatplotlibIn this demo tutorial, we introduce the color cycle and see how to get and set the color property with the help of the color cycle in Matplotlib. Matplotlib PyCharmIn this article, we will learn installing Matplotlib in PyCharm IDE. We are also visualizing the data in line, bar, histogram, grid, and marker plots. No Handles With Labels Found to Put in LegendThis article demonstrates how we can solve the warning (No handles with labels found to put in legend) when trying to plot something with Matplotlib. Magic Function Inline in MatplotlibIn this demonstration we learn what is magic function then we see different magic functions available in Matplotlib after this we discuss the inline function.