CBSE Class 12 Informatics Practices Question 42 of 73

Data Visualization using Matplotlib — Question 7

Back to all questions
7
Question

Question 7

What is the use of subplot() function? Write its parameters.

Answer

The subplot() function is used to display multiple charts in the same window.

The syntax of the subplot() function is: subplot(nrows, ncols, index).

The parameters are:

  1. nrows: The number of rows in the grid of subplots.
  2. ncols: The number of columns in the grid of subplots.
  3. index: The index of the subplot to create, starting from 1 and increasing from left to right, top to bottom.