Question:

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: Sep 18, 2025
  • 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.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Understanding the \texttt{fill=False parameter.}
In pandas, when plotting histograms, the \texttt{fill} parameter controls whether the bars are filled with color. Setting \texttt{fill=False} makes the histogram bars unfilled (empty).
Step 2: Evaluate each option.
- Option (1) Each hist will be filled with green color: This is incorrect. The \texttt{fill=False} parameter ensures the bars are not filled. - Option (2) Each hist will be empty: This is the correct answer. With \texttt{fill=False}, the bars will have no fill, leaving them empty inside. - Option (3) Each hist will be filled with ':': This is incorrect. The \texttt{hatch} parameter is used for patterns, not for filling with a specific character like ':'. - Option (4) The edge color of each hist will be black: This is incorrect. The edge color is set to "Green" in the \texttt{edgecolor} argument, not black.
Step 3: Conclusion.
The \texttt{fill=False} parameter causes the histogram bars to be empty.
Final Answer: \[ \boxed{\text{The fill=False parameter makes each histogram bar empty.}} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions