Question:medium

Given the following code for histogram:

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

What is the role of fill=False?

Show Hint

When \texttt{fill=False} is used, the histogram bars will not be filled with color. You can use \texttt{hatch} to add patterns to the bars if needed.
Updated On: Feb 16, 2026
  • Each hist will be filled with green color.
  • Each hist will be empty.
  • Each hist will be filled with ‘:’.
  • The edge color of each hist will be black.
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Understanding the \texttt{fill=False} parameter.
In pandas, the \texttt{fill} parameter for histograms determines if the bars are colored. Setting \texttt{fill=False} results in unfilled (empty) histogram bars.
Step 2: Evaluate each option.
- Option (1) Each hist will be filled with green color: Incorrect. \texttt{fill=False} prevents bars from being filled.- Option (2) Each hist will be empty: Correct. \texttt{fill=False} causes bars to have no fill, making them empty.- Option (3) Each hist will be filled with ':': Incorrect. The \texttt{hatch} parameter is for patterns, not for filling with characters like ':'.- Option (4) The edge color of each hist will be black: Incorrect. The \texttt{edgecolor} argument is set to "Green", not black.
Step 3: Conclusion.
The \texttt{fill=False} parameter makes histogram bars empty.
Final Answer: \[\boxed{\text{The fill=False parameter makes each histogram bar empty.}}\]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam