1. Home
  2. Data Science
  3. Matplotlib
  4. In plt.plot(x, y, 'r--'), what does the format string…

Added 2 Nov 2026

In plt.plot(x, y, 'r--'), what does the format string 'r--' specify?

  1. A round marker only
  2. A red dotted line
  3. A reversed x-axis
  4. A red dashed line Correct answer

Correct answer

D. A red dashed line

19 views

MCQSEXAM

Explanation

Format strings combine colour, marker and line style: 'r' is red and '--' dashed. 'b:' would be a blue dotted line, and 'go' green circles.

Reference

Asked in: Data Science Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? 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