Bird
0
0

Why might setting transparent=True in plt.savefig() not produce a transparent background in some image viewers?

hard📝 Conceptual Q10 of 15
Matplotlib - Export and Publication Quality
Why might setting transparent=True in plt.savefig() not produce a transparent background in some image viewers?
AThe matplotlib version is outdated.
BThe plot lines are too thick.
CThe figure size is too small.
DThe image format does not support transparency.
Step-by-Step Solution
Solution:
  1. Step 1: Understand image format support for transparency

    Some image formats like JPEG do not support transparency, so even if saved with transparent=True, transparency is lost.
  2. Step 2: Check viewer and format compatibility

    PNG supports transparency, but JPEG does not. Also, some viewers may not display transparency correctly.
  3. Final Answer:

    The image format does not support transparency. -> Option D
  4. Quick Check:

    Transparency depends on image format support [OK]
Quick Trick: Use PNG format for transparency support [OK]
Common Mistakes:
  • Blaming plot line thickness for transparency issues
  • Assuming figure size affects transparency
  • Ignoring image format limitations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Matplotlib Quizzes