1. Home
  2. Data Science
  3. Matplotlib
  4. What is the output of plt.plot([1, 2, 3], [4, 5, 6]…

Added 24 Feb 2024

What is the output of plt.plot([1, 2, 3], [4, 5, 6], linestyle='--')?

  1. A line plot with dashed lines Correct answer
  2. A bar plot
  3. A scatter plot
  4. An error

Correct answer

A. A line plot with dashed lines

13 views

MCQSEXAM

Explanation

It draws a line plot with dashed lines through the points (1,4), (2,5) and (3,6). linestyle='--' selects dashes.

Other styles are '-' solid, ':' dotted and '-.' dash-dot.

For more solved questions like this one, see Data Science MCQs 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