Data Visualization MCQ Questions
Data Visualization MCQ Questions
b. Visual Data
c. Matplot
Q2. Which of the following library to be imported for creating chart in python?
a. Matplotlib
b. Pandas
c. Math
d. Random
b. matplot
c. pyplot
b. ploting( )
c. plot( )
d. plots( )
b. Legend
c. Axis labels
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)
b. x ticks
c. xy ticks
b. x ticks
c. xy ticks
Q11. plot(a, b) is provided with two parameters, which indicates values for _______________
a. x-axis and y-axis, respectively
c. x-axis only
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( )
b. show( )
c. savefig( )
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( )
Q19. Which of the following pyplot function is used to set the values on the x-axis.
a. xticks( )
b. xlabel( )
c. xvalues( )
Q20. Which of the following pyplot function is used to set a title for the chart.
a. Title( )
b. c_title( )
c. title( )
b. plt.grid(True)
Q22. A ___________ is any symbol that represents a data value in a line chart.
a. marker
b. mark
c. marks
b. plot( )
c. display( )
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)
b. plt.plot(h, w, mark = “*”) #h and w are data representing x axis and y axis
c. plt.marker(“*”)
b. plot( )
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)
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”)
b. sizeofmarker
c. markersize
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
b. styleline
c. styleofline
Q34. Which attribute of plot( ) function is used to set the edge color of bar in bar chart?
a. bordercolor
b. colorofedge
c. edgecolor
Q35. Which attribute of plot( ) function is used to set the different color of bars in bar chart?
a. color
b. barcolor
c. colorbar
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
Q38. Which attribute is used to change the border color of each hist in histogram?
a. border color
b. colorofborder
c. edgecolor
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]
b. matplotlib.pyplot
c. matplot.pyplot
b. bargraph
c. histogram
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
b. linechart( )
c. plot( )
d. plotter( )
b. Legend
c. legends
b. barh( )