Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Q1.

__________________ means graphical or pictorial representation of the data using graph,


chart, etc.
a. Data visualization

b. Visual Data

c. Matplot

d. None of the above

Q2. Which of the following library to be imported for creating chart in python?
a. Matplotlib

b. Pandas

c. Math

d. Random

Q3. Which module of matplotlib library is required for plotting of graph?


a. plot

b. matplot

c. pyplot

d. None of the above

Q4. Which of the following command is correct to install matplotlib?


a. pip install matplot

b. pipe install matplotlib

c. pip install matplotlib

d. None of the above


Q5. _____________ function of the pyplot module is used to create a figure/chart/plot.
a. show( )

b. ploting( )

c. plot( )

d. plots( )

Data Visualization MCQ Class XII IP


Q6. A figure/chart contains ______
a. Plotting area

b. Legend

c. Axis labels

d. All of the above

Q7. ______________ function is used to display figure/chart.


a. showing( )

b. show( )

c. display( )

d. screen( )

Q8. To plot x versus y, we can write ________________ #plt is an alias for matplotlib.pyplot
a. plt.plot(y, x)

b. plt.plot(x)

c. plt.plot(x,y)

d. None of the above


Q9. Values which are displayed on x-axis is called ___________
a. y ticks

b. x ticks

c. xy ticks

d. None of the above

Q10. Values which are displayed on y-axis is called ________________


a. y ticks

b. x ticks

c. xy ticks

d. None of the above

Q11. plot(a, b) is provided with two parameters, which indicates values for _______________
a. x-axis and y-axis, respectively

b. y-axis and x-axis, respectively

c. x-axis only

d. None of the above

Q12. By default plot() function plots a ________________


a. Histogram

b. Bar graph

c. Line chart

d. Pie chart
Q13. Which of the following function is used to save the figure/chart?
a. save( )

b. savefigure( )

c. savefig( )

d. None of the above

Q14. Name of the figure is passed to the ________________ function as parameter.


a. plot( )

b. show( )

c. savefig( )

d. None of the above

Q15. Which of the following pyplot function is used to plot histogram.


a. histogram( )

b. histo( )

c. histochart( )

d. hist( )

Q16. Which of the following pyplot function is used to plot pie chart.
a. pie( )

b. piechart( )

c. circle( )

d. oval( )
Q17. Which of the following pyplot function is used to plot bar graph.
a. bargraph( )

b. bar( )

c. barchart( )

d. oval( )

Q18. Which of the following pyplot function is used to set the label for the x-axis.
a. xlabeled( )

b. xlabel( )

c. x_axis_label( )

d. None of the above

Q19. Which of the following pyplot function is used to set the values on the x-axis.
a. xticks( )

b. xlabel( )

c. xvalues( )

d. None of the above

Q20. Which of the following pyplot function is used to set a title for the chart.
a. Title( )

b. c_title( )

c. title( )

d. None of the above


Q21. To show the grid lines in plot, we can write _______________ #plt is an alias of
matplotlib.pyplot
a. plt.grid( )

b. plt.grid(True)

c. Both of the above

d. None of the above

Q22. A ___________ is any symbol that represents a data value in a line chart.
a. marker

b. mark

c. marks

d. None of the above

Q23. ‘marker’ is an attribute of ____________ function.


a. show( )

b. plot( )

c. display( )

d. None of the above

Q24. Write a statement to display “Amount” as x-axis label. (consider plt as an alias name of
matplotlib.pyplot)
a. plt.label(“Amount”)

b. plt.xlabel(“Amount”)

c. plt.xlabel(Amount)

d. None of the above


Q25. Write a statement to “use * as marker” . (consider plt as an alias name of matplotlib.pyplot)
a. plt.plot(h, w, marker = “*”) #h and w are data representing x axis and y axis

b. plt.plot(h, w, mark = “*”) #h and w are data representing x axis and y axis

c. plt.marker(“*”)

d. None of the above

Q26. Series and DataFrame have their own __________ function.


a. show( )

b. plot( )

c. both of the above

d. none of the above

Q27. If we have a Series type object (let’s say ‘s1’ ) we can call the plot method by writing
_____________
a. s1.plot( )

b. plot(s1)

c. s1.plot(s1)

d. None of the above

Q28. Which attribute of plot( ) function help to specify the type of chart?
a. type

b. kind

c. kinds
d. types

Q29. Statement to plot a line chart for data stored in a DataFrame ‘df’ is _____
a. df.plot(line)

b. plot(df, line)

c. df.plot(kind = “line”)

d. None of the above

Q30. Attribute/parameter to set marker size is _____


a. marker size

b. sizeofmarker

c. markersize

d. None of the above

Q31. A _____________ plot is a graph that shows the frequency of data along a number line.
a. line

b. box

c. histogram

d. bargraph

Q32. Which attribute of plot( ) function is used to set the width of line in line plot?
a. widthline

b. linewidth

c. widthofline

d. none of the above


Q33. Which attribute of plot( ) function is used to set the style of line in line plot?
a. linestyle

b. styleline

c. styleofline

d. none of the above

Q34. Which attribute of plot( ) function is used to set the edge color of bar in bar chart?
a. bordercolor

b. colorofedge

c. edgecolor

d. none of the above

Q35. Which attribute of plot( ) function is used to set the different color of bars in bar chart?
a. color

b. barcolor

c. colorbar

d. none of the above

Q36. ____________ are column-charts, where each column represents a range of values, and
the height of a column corresponds to how many values are in that range.
a. Bar graph

b. Histograms

c. Line chart

d. pie chart
Q37. Which parameter of plot( ) function help to set the values of bins in Histogram?
a. bin

b. bins

c. binvalue

d. none of the above

Q38. Which attribute is used to change the border color of each hist in histogram?
a. border color

b. colorofborder

c. edgecolor

d. none of the above

Q39. Which attribute is used to fill each hist with pattern in histogram?
a. pattern

b. fill

c. hatch

d. color

Q40. What is the default value of fill property in plot( ) function of creating histogram?
a. True

b. False

c. Green

d. Black
Q41. Fill in the blank in the given code, if we want to plot a line chart for values of list ‘a’ vs
values of list ‘b’.
a = [1, 2, 3, 4, 5]
b = [10, 20, 30, 40, 50]
import matplotlib.pyplot as plt
plt.plot __________
a. (a, b)

b. (b, a)

c. [a, b]

d. None of the above

Q42. Which of the following is used to design 2D charts/graphs/figures?


a. matplotlib.pythonplot

b. matplotlib.pyplot

c. matplot.pyplot

d. none of the above

Q43. The following code will create __________ .


import matplotlib.pyplot as pl
a = [1,2,3,4,5]
b = [10, 20, 30, 40, 50]
c = [5, 10, 15, 20, 25]
pl.plot(a,b)
pl.plot(a,c)
pl.show()
a. line chart

b. bargraph

c. histogram

d. None of the above


Q44. The following code will show ___________ lines in the figure/chart.
import matplotlib.pyplot as pl
a = [1,2,3,4,5]
b = [10, 20, 30, 40, 50]
c = [5, 10, 15, 20, 25]
pl.plot(a,b)
pl.plot(a,c)
pl.show()
a. 1

b. 2

c. 3

d. 4

Q45. The following statement will create line plot of __________ color.
pl.plot(a, b, ‘g’) #a and b are list

a. black

b. yellow

c. green

d. magenta

Q46. Which of the following chart can not be created by using matplotlib.pyplot ?
a. Box

b. Stats

c. Pie

d. Line

Q47. Which of the following function is used to plot a line chart?


a. line( )

b. linechart( )

c. plot( )

d. plotter( )

Q48. Which function is used to display the legend in plot?


a. legend

b. Legend

c. legends

d. All of the above

Q49. Which of the following function will create bar chart?


a. bar( )

b. barh( )

c. Both of the above

d. None of the above

Q50. The following code will create _______


pl.plot(a) #a is a list and pl is an alias of matplotlib.pyplot
a. line chart with no values on x axis

b. line chart with no values on y axis

c. line chart with values on both the axis

d. None of the above

You might also like