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?
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
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.
Related questions:
2025: 15 May Shift 2
2025: 21 May Shift 1
2026: 29 May Shift 2
2026: 23 May Shift 1