AMP

Chapter 16: Data Visualization Using Pyplot — Online MCQ Test

COMPUTER SCIENCE · CLASS 12th · Tamil Nadu State Board
Practice Chapter 16: Data Visualization Using Pyplot with a free chapter-wise online MCQ test. This chapter covers: The final chapter focuses on presenting data visually using the Matplotlib Pyplot library. Students learn to plot line charts pie charts and bar charts while customizing titles lab.... AI-generated questions from basic to board-exam level, with instant results and explanations.

Start Exam on Full Site →

Chapter 16: Data Visualization Using Pyplot — Important Questions & Answers

Which Python library is used with Pyplot for data visualization in this chapter?
  • A. Matplotlib
  • B. NumPy
  • C. Pandas
  • D. SciPy
Answer: A. Matplotlib
Pyplot is a module of the Matplotlib library. It is commonly used to create graphs and charts in Python.
Which Pyplot function is used to display a line chart?
  • A. plt.line()
  • B. plt.plot()
  • C. plt.draw()
  • D. plt.showline()
Answer: B. plt.plot()
The plt.plot() function is used to draw line graphs in Matplotlib. It is one of the most basic plotting functions.
In plt.plot(x, y), what do x and y usually represent?
  • A. Only labels of the graph
  • B. Data values for horizontal and vertical axes
  • C. Color and line style
  • D. Title and legend
Answer: B. Data values for horizontal and vertical axes
In a plot, x values are placed on the horizontal axis and y values on the vertical axis. Together they define the points to be drawn.
Which of the following is NOT a basic chart type discussed in this chapter?
  • A. Line chart
  • B. Pie chart
  • C. Bar chart
  • D. Histogram
Answer: D. Histogram
This chapter focuses on line charts, pie charts, and bar charts using Pyplot. Histogram is not one of the main chart types listed here.
Which command correctly sets the title and x-axis label for a plot?
  • A. plt.xlabel('Marks'); plt.title('Result')
  • B. plt.ylabel('Result'); plt.title('Marks')
  • C. plt.legend('Result'); plt.xlabel('Marks')
  • D. plt.grid('Result'); plt.title('Marks')
Answer: A. plt.xlabel('Marks'); plt.title('Result')
plt.title() is used for the graph title and plt.xlabel() is used for the x-axis label. The other options use the functions incorrectly.