Multiple Choice Question For Plotting with PyPlot Class 12 Informatics Practices (IP)
1. Which Python package is used for 2D graphics?
(a) matplotlib.pyplot
(b) matplotlib.pip
(c) matplotlib.numpy
(d) matplotlib.plt
2. The most popular data visualization library in Python is:
(a) pip
(b) matinfolib
(c) matplotlib
(d) matpiplib
3. Matplotlib allows you to create:
(a) table
(b) charts
(c) maps
(d) infographics
4. Which of the following is not a visualization under matplotlib?
(a) Scatter plot
(b) Histogram
(c) Box plot
(d) Table plot
5. Which plot displays the distribution of data based on the five-number summary?
(a) Scatter plot
(b) Line plot
(c) Box plot
(d) Chart plot
6. Which of the following commands is used to install matplotlib for coding?
(a) import plt.matplotlib as plot
(b) import plot.matplotlib as pt
(c) import matplotlib.plt as plot
(d) import matplotlib.pyplot as plt
7. Which of the following methods should be employed in the code to display a plot()?
(a) show()
(b) display()
(c) execute()
(d) plot()
8. Which of the following statements is used to create a histogram of 'step' type with 20 bins?
(a) plt.hist(x, bins = 20, histype = "barstacked")
(b) plt.hist(x, bins = 20)
(c) plt.hist(x, bins = 20, histype = "step")
(d) plt.hist(x, bins = 20, histype = hist()
9. Which of the following plots makes it easy to compare two or more distributions on the same set of axes?
(a) Box plot
(b) Histogram
(c) Frequency polygon
(d) Bar chart
10. The part of chart which identifies different sets of data plotted on plot by using different colours is called:
(a) legends
(b) title
(c) axes
(d) figure
11. Which of the following is an incorrect example of savefig() function?
(a) plt.savefig("bar1.pdf")
(b) plt.savefig("bar1.png")
(c) plt.savefig("bar1.eps")
(d) plt.savefig("bar1.ppt")
12. Which of the following plots makes it easy to compare two or more distributions on the same set of axes?
(a) Box plot
(b) Histogram
(c) Frequency polygon
(d) Bar chart
13. Consider the snippet given below:
import matplotlib.pyplot as plt
#arr1, arr2 defined here
colors = ['r', 'b', 'K', 'g, 'm']
sizes = [50, 120, 220, 150, 80]
plt.scatter(arr1, arr2, c = colors, s = sizes, marker = "s")
With reference to the above code, what will be the shape of marker?
(a) square
(b) circle
(c) star
(d) diamond
14. With reference to the code, what will be the colour of the last point?
import matplotlib.pyplot as plt
#arr1, arr2 defined here
colors = ['r', 'b', 'K', 'g, 'm']
sizes = [50, 120, 220, 150, 80]
plt.scatter(arr1, arr2, c = colors, s = sizes, marker = "s")
(a) Red
(b) Blue
(c) Black
(d) Magenta
15. The scatter() function:
(a) is a powerful method of creating scatter plots than plot() function
(b) can create line graph
(c) can create bar graph
(d) None of the above
16. PyPlot is an interface of Python's _____ library.
(a) seaborn
(b) plotly
(c) ggplot
(d) matplotlib
17. For 2D plotting using a Python library, which library interface is often used ?
(a) seaborn
(b) plotly
(c) matplotlib
(d) matplotlib.pyplot
18. Which of the following is not a valid chart type ?
(a) histogram
(b) statistical
(c) pie
(d) box
19. Which of the following is not a valid plotting function of pyplot ?
(a) plot()
(b) bar()
(c) line()
(d) pie()
20. Which of the following plotting functions does not plot multiple data series?
(a) plot()
(b) bar()
(c) pie()
(d) barh()
21. The plot which tells the trend between two graphed variables is the _____ graph/chart.
(a) line
(b) scatter
(c) bar
(d) pie
22. The plot which tells the correlation between two variables which may not be directly related is _____ graph/chart.
(a) line
(b) scatter
(c) bar
(d) pie
23. A _____ is a summarisation tool for discrete or continuous data.
(a) quartile
(b) histogram
(c) mean
(d) median
24. A visual representation of the statistic five number summary of a given dataset is known as _____.
(a) histogram
(b) frequency distribution
(c) boxplot
(d) frequency polygon
25. Which of the following functions is used to create a line chart?
(a) line()
(b) plot()
(c) chart()
(d) plotline()
26. Which of the following function will produce a bar chart?
(a) plot()
(b) bar()
(c) plotbar()
(d) barh()
27. Which of the following function will create a vertical bar chart ?
(a) plot()
(b) bar()
(c) plotbar()
(d) barh()
28. Which of the following function will create a horizontal bar chart ?
(a) plot()
(b) bar()
(c) plotbar()
(d) barh()
29. To specify the style of line as dashed, which argument of plot() needs to be set ?
(a) line
(b) width
(c) style
(d) linestyle
30. The datapoints plotted on a graph are called _____.
(a) points
(b) pointers
(c) marks
(d) markers
31. A _____ graph is a type of chart which displays information as a series of data points connected by straight line segments.
(a) line
(b) bar
(c) pie
(d) boxplot
32. To create scatter charts using plot( ), which argument is skipped ?
(a) marker
(b) linestyle
(c) markeredgecolor
(d) linewidth
33. In scatter(), which argument is used to specify the size of datapoints?
(a) size
(b) s
(c) marker
(d) markersize
34. Which argument of bar() lets you set the thickness of bar ?
(a) thick
(b) thickness
(c) width
(d) barwidth
35. Which function lets you set the title of the plot ?
(a) title()
(b) plottitle()
(c) graphtitle()
(d) all of these
36. Which function would you use to set the limits for x-axis of the plot ?
(a) limits()
(b) xlimits()
(c) xlim()
(d) lim()
37. Which function is used to show legends ?
(a) display()
(b) show()
(c) legend()
(d) legends()
38. Which argument must be set with plotting functions for legend() to display the legends ?
(a) data
(b) label
(c) name
(d) sequence
39. Which function is used to create a histogram ?
(a) histo()
(b) histogram()
(c) hist()
(d) histtype
40. Which argument in hist() is used to create a stacked bar type histogram ?
(a) histt
(b) histtype
(c) type
(d) barstacked
41. Which of the following functions can plot only one data series?
(a) plot()
(b) bar()
(c) boxplot()
(d) pie()
42. Which argument must be provided to create wedges out of a pie chart ?
(a) label
(b) autopct
(c) explode
(d) wedge
43. Which argument should be set to display percentage share of each pie on a pie chart?
(a) label
(b) autopct
(c) explode
(d) wedge
44. Which function creates a boxplot ?
(a) box()
(b) plot()
(c) boxplot()
(d) showbox()
45. Which argument of boxplot() is used to create a filled boxplot ?
(a) fill
(b) box
(c) patch_artist
(d) patch
Answers:
1. (a)
2. (c)
3. (b)
4. (d)
5. (c)
6. (d)
7. (a)
8. (c)
9. (c)
10. (a)
11. (d)
12. (c)
13. (a)
14. (d)
15. (a)
16. (d)
17. (d)
18. (b), (d)
19. (c)
20. (c)
21. (a)
22. (b)
23. (b)
24. (c)
25. (b)
26. (b), (d)
27. (b)
28. (d)
29. (d)
30. (d)
31. (a)
32. (b)
33. (b)
34. (c)
35. (a)
36. (c)
37. (c)
38. (b)
39. (c)
40. (b)
41. (d)
42. (c)
43. (b)
44. (c)
45. (c)
How can i download this qns.
ReplyDeleteI kinda need it
You can Copy it and save it : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )