Skip to main contentSkip to solution

Given the following code for histogram:

df.plot(kind='hist', edgecolor="Green", linewidth=2, linestyle=':', fill=False, hatch='o')

What is role of fill=False?

Solution

✅ Correct Option: 2

In Matplotlib's bar patches, fill=False turns off the face color, so each bar is drawn as an outline only, with no solid fill.

The outline still appears, because edgecolor and linewidth are set separately. The hatch='o' pattern is also drawn inside the bars, but there is no background color.


Option 1: green is the edgecolor, which colors the border and not the inside of the bars.

Option 3: ':' is the linestyle, which makes the border dotted. It is not a fill.

Option 4: the edge color is set to Green, not black.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question