Matplotlib PyPlot – Bar Plot without Filling the Bar Faces

To draw a Bar Plot without filling the bar faces in Matplotlib, call function, and pass False for fill parameter.

The following is the code snippet to call bar() function with fill parameter set to False. Of course there would be other parameters like x, height, etc., but for understanding fill parameter, only fill parameter has been specified.



In the following program, we will draw a bar plot, with the bar faces not filled with color. Only the outline is displayed.

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
h = [10, 8, 12, 4, 7]

#bar plot, height = h, fill = False)


Matplotlib - Bar Plot - No Fill


In this Matplotlib Tutorial, we learned how to draw bar plot without filling the bar faces with color, using Matplotlib PyPlot API.