1. Home
  2. Data Science
  3. Matplotlib
  4. What function is used to set the transparency of elements…

Added 24 Feb 2024

What function is used to set the transparency of elements in a plot in Matplotlib?

  1. plt.set_alpha() Correct answer
  2. plt.set_transparency()
  3. plt.set_opacity()
  4. plt.set_alpha_channel()

Correct answer

A. plt.set_alpha()

17 views

MCQSEXAM

Explanation

Transparency is controlled by the alpha value, set with set_alpha() on a plot element or, more commonly, with the alpha argument: plt.plot(x, y, alpha=0.5).

Alpha runs from 0 (fully transparent) to 1 (fully opaque).

Practise more Data Science MCQs with answers and explanations on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Matplotlib MCQs

Practise all Matplotlib MCQs

Similar MCQs