TN Online TestSamacheer Kalvi practice

12th Standard Computer Science — Data visualization using pyplot: line chart, pie chart and bar chart: Additional MCQs with Answers & Explanations

Share this chapter: Telegram

15 extra multiple-choice questions for Data visualization using pyplot: line chart, pie chart and bar chart (12th Standard Computer Science, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.

Answer key at a glance

Q1
Which parameter of the plt.pie() function in Matplotlib is used to display the percentage value on each slice of a pie chart using Python string formatting?
  • A. percent
  • B. autopctCorrect
  • C. show_pct
  • D. pct_format
Explanation. The autopct parameter in plt.pie() is used to automatically format and display the percentage values of each slice on the pie chart.
Q2
In Matplotlib, if you pass only a single list of numbers to the plt.plot() command, how does the library interpret these values?
  • A. As a sequence of x-coordinates, with y-coordinates default to 0
  • B. As a sequence of y-coordinates, with automatically generated x-coordinates starting from 0Correct
  • C. As alternating x and y coordinates of a single point
  • D. As coordinates of points on a diagonal line
Explanation. When a single list is passed to plt.plot(), Matplotlib assumes they are y-values and generates the x-values as a sequence starting from 0.
Q3
Which button in the Matplotlib output window allows you to return to the original view after navigating or zooming into a chart?
  • A. Zoom Button
  • B. Pan Axis Button
  • C. Home ButtonCorrect
  • D. Configure Subplots Button
Explanation. The Home Button in the navigation toolbar of the Matplotlib output window is clicked to return the chart to its original view.
Q4
What is the primary difference in data representation between a Histogram and a Bar Graph?
  • A. A histogram represents discrete categories, while a bar graph represents continuous variables.
  • B. A histogram represents the frequency distribution of continuous variables, while a bar graph compares discrete variables.Correct
  • C. A histogram always has equal spacing between the bars, while a bar graph has no gaps.
  • D. A histogram displays categorical data, while a bar graph displays numerical data.
Explanation. Histograms represent the frequency distribution of continuous variables with no gaps between bars, whereas bar graphs compare categorical, discrete variables.
Q5
Which of the following commands is used to add a label specifically to the horizontal axis of a plot in Matplotlib?
  • A. plt.title()
  • B. plt.ylabel()
  • C. plt.xlabel()Correct
  • D. plt.legend()
Explanation. The plt.xlabel() function is used in Matplotlib to set the text label for the x-axis, which is the horizontal axis.
Q6
How is zooming out performed using the Zoom button in the Matplotlib window?
  • A. By left-clicking and dragging a square
  • B. By right-clicking and dragging a squareCorrect
  • C. By double-clicking the zoom button
  • D. By pressing the Home button twice
Explanation. In the Matplotlib chart window, zooming in is done by left-clicking and dragging, while zooming out is done by right-clicking and dragging.
Q7
What type of data visualization is characterized as a standardized way of displaying the distribution of data based on a five-number summary?
  • A. Scatter plot
  • B. Box plotCorrect
  • C. Histogram
  • D. Line plot
Explanation. A box plot standardizes the display of a dataset's distribution using its five-number summary: minimum, first quartile, median, third quartile, and maximum.
Q8
Which visualization in Matplotlib represents data as a collection of individual points whose positions depend on two-dimensional values?
  • A. Line plot
  • B. Histogram
  • C. Scatter plotCorrect
  • D. Box plot
Explanation. A scatter plot displays data as a collection of individual points, where the coordinates of each point are determined by its two-dimensional values.
Q9
What is the default starting value of the generated x-coordinates when only a single list of y-values is plotted using Matplotlib?
  • A. 1
  • B. -1
  • C. 0Correct
  • D. The first value of the list
Explanation. Because Python ranges and indexing start at 0, the default x-vector automatically generated by Matplotlib starts at 0 and ends at n-1.
Q10
Which utility software or package manager is used to install the Matplotlib library in Python?
  • A. IDLE
  • B. pipCorrect
  • C. g++
  • D. Pyplot
Explanation. Matplotlib is installed in Python environments using pip, which is the standard package manager for Python libraries.
Q11
Which button in the Matplotlib window toolbar allows you to change spacing options for the figure and its plot?
  • A. Save Figure Button
  • B. Configure Subplots ButtonCorrect
  • C. Pan Axis Button
  • D. Home Button
Explanation. The Configure Subplots button allows the user to adjust and configure various spacing and layout parameters of the figure.
Q12
Why is a Line Chart or Line Graph particularly well-suited for visualizing chronological data?
  • A. It is designed to show the proportion of parts out of a whole.
  • B. It displays continuous variables with no spacing between rectangular blocks.
  • C. It represents a trend in data over intervals of time by connecting sequential data points.Correct
  • D. It only displays categorical data on both the horizontal and vertical axes.
Explanation. Line charts connect sequential data points, making them ideal for showing changes and trends in variables over chronological time intervals.
Q13
In the Matplotlib window, which button is clicked to drag the entire graph around to view different sections?
  • A. Zoom
  • B. Pan AxisCorrect
  • C. Forward
  • D. Home
Explanation. The Pan Axis button (resembling cross-arrows) allows users to click and drag the plot canvas to navigate around the graph.
Q14
In a bar graph, how do the widths of the rectangular blocks compare to each other, and how does this contrast with a histogram?
  • A. Block widths in a bar graph are always equal, whereas in a histogram they may or may not be the same.Correct
  • B. Block widths in a bar graph may vary, whereas in a histogram they must be identical.
  • C. Both bar graphs and histograms must have identical, fixed block widths.
  • D. Bar graphs do not use rectangular blocks, while histograms do.
Explanation. The width of bars in a bar graph is always uniform, while the width of blocks in a histogram can vary depending on class intervals.
Q15
What is the primary purpose of using the plt.legend() function in a Matplotlib script with multiple lines?
  • A. To display the title at the top of the chart window
  • B. To assign different colors to the plotted lines automatically
  • C. To display a box containing labels that identify each plotted lineCorrect
  • D. To save the output figure as a separate image file
Explanation. plt.legend() invokes the plot's legend, displaying a box with the labels assigned to each plotted line for easy identification.
Take the Additional practice test → Open the app

More for this chapter

Book Back Questions9 textbook MCQs · solved Practice TestInteractive · instant score Book Back TestTest yourself on the textbook set Additional MCQ TestTest yourself on the extra set Study NotesConcepts & methods Formula SheetAll key formulas

About these Data visualization using pyplot: line chart, pie chart and bar chart questions

These are the Additional multiple-choice questions for Data visualization using pyplot: line chart, pie chart and bar chart from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Science syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.

Frequently asked questions

How many MCQs are there in Data visualization using pyplot: line chart, pie chart and bar chart?

This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.

Are these 12th Standard Computer Science MCQs free to practise online?

Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.

Where can I find the Data visualization using pyplot: line chart, pie chart and bar chart book-back answers?

The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.

More chapters in Computer Science

View all
1 Function 2 Data Abstraction 3 Scoping 4 Algorithmic Strategies 5 Python -Variables and Operators 6 Control Structures 7 Python functions 8 Strings and String manipulation 9 Lists, Tuples, Sets and Dictionary 10 Python Classes and objects 11 Database Concepts 12 Structured Query Language (SQL) 13 Python and CSV files 14 Importing C++ programs in Python. 15 Data manipulation through SQL