Bird
0
0

What will be the output type of this code?

medium📝 Predict Output Q4 of 15
Matplotlib - Export and Publication Quality
What will be the output type of this code?
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.savefig('plot.svg')
ARaster image
BText file
CVector image
D3D model
Step-by-Step Solution
Solution:
  1. Step 1: Check file extension

    The file is saved as 'plot.svg', which is a vector format.
  2. Step 2: Understand matplotlib default behavior

    Matplotlib saves SVG files as vector graphics by default.
  3. Final Answer:

    Vector image -> Option C
  4. Quick Check:

    SVG extension = Vector output [OK]
Quick Trick: SVG files are vector by default [OK]
Common Mistakes:
  • Assuming SVG is raster
  • Confusing file extension
  • Ignoring matplotlib defaults

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Matplotlib Quizzes