Python Tutorial: MCQ Plotting with Plot

Monday, 2 August 2021

MCQ Plotting with Plot

Q1.        

A _____ graph is a type of chart which displays information as a series of data connected by straight line segments.

a)   line

b)   bar

c)   pie

d)   boxplot

Ans :a)

Q2.        

A _________ summarisation tool for discrete or continuous data.

a)   Quartile

b)   Histogram

c)   Mean

d)   Median

Ans: b)

Q3.        

A visual representation of the statistical five number summary of a given data set is known as ______

a)   Histogram

b)   Frequency distribution

c)   Boxplot

d)   Frequency Polygram

Ans: c)

Q4.        

For 2D plotting using a Python library, which library interface is often used?

a)    seaborn

b)   plotly

c)   matplotlib

d)   matplotlib.pyplot

Ans: d)

Q5.        

Identify the package manager for Python packages, or modules.

a)   Matplotlib

b)   PIP

c)   plt.show()

d)   python package

Ans :  a

Q6.        

Identify the right type of chart using the following hints.    

Hint 1: This chart is often used to visualize a trend in data over intervals of time.

Hint 2: The line in this type of chart is often drawn chronologically.

a)   Line chart

b)   Bar chart

c)   Pie chart

d)   Scatter plot

Ans :  a

Q7.        

In scatter(), which argument is used to specify the size of datapoints?

a)   size

b)   s

c)   marker

d)   markersize

Ans: b)

Q8.        

Observe the output figure. Identify the coding for obtaining this output.




a)   import matplotlib.pyplot as plt

plt.plot([1,2,3],[4,5,1])

plt.show()

b)    import matplotlib.pyplot as plt

plt.plot([1,2],[4,5])

plt.show()

c)   import matplotlib.pyplot as plt

plt.plot([2,3],[5,1])

plt.show()

d)   import matplotlib.pyplot as plt

plt.plot([1,3],[4,1])

plt.show()

Ans :  a

Q9.        

Point out the correct combination with regards to kind keyword for graph plotting.

a)   ‘hist’ for histogram

b)   ‘box’ for boxplot

c)   ‘area’ for area plots

d)   all of the mentioned

Ans: d

Q10.    

Point out the wrong combination with regards to kind keyword for graph plotting.

a)   ‘scatter’ for scatter plots

b)   ‘kde’ for hexagonal bin plots

c)   ‘pie’ for pie plots

d)   none of the mentioned

Ans: b

Q11.    

Point out the wrong combination with regards to kind keyword for graph plotting.
a) ‘scatter’ for scatter plots
b) ‘kde’ for hexagonal bin plots
c) ‘pie’ for pie plots
d) none of the mentioned

Ans: b

Q12.    

PyPlot is an interface of Python’s ________ library.

a)   seaborn

b)   plotly

c)   ggplot

d)   matplotlib

Ans: d)

Q13.    

Read the code:

import matplotlib.pyplot as plt

plt.plot(3,2)

plt.show()

Identify the output for the above coding.

a)  


b)  


 

c)  


 

d)  


Ans : c

Q14.    

Read the following code: Identify the purpose of this code and choose the right  from the following.

C:\Users\YourName\AppData\Local\Programs\Python\Python36-32\Scripts>pip list

a)   List installed packages

b)   list command

c)   Install PIP

d)   packages installed

Ans :  a

 

Q15.    

The datapoints plotted on a graph are called_______.

a)   points

b)   ponters

c)   marks

d)   markers

Ans: d)

Q16.    

The plot method on Series and DataFrame is just a simple wrapper around ____________

a)   gplt.plot()

b)   plt.plot()

c)   plt.plotgraph()

d)   none of the mentioned

Ans: b

Q17.    

The plot which tell the correlation between two variables which may not be directly related is ____ graph/chart.

a)   line

b)   scatter

c)   bar

d)   pie

Ans: b)

Q18.    

The plot which tells the trend between two graphed variables is the ____ graph/chart.

a)   line

b)   scatter

c)   bar

d)   pie

Ans: a)

Q19.    

To create scatter charts using plot(), which argument is skipped?

a)   marker

b)   linestyle

c)   markeredgecolor

d)   linewidth

Ans: b)

Q20.    

To install matplotlib, the following function will be typed in your command prompt. What does “-U”represents?

Python –m pip install –U pip

a)   downloading pip to the latest version

b)   upgrading pip to the latest version

c)   removing pip

d)   upgrading matplotlib to the latest version

Ans :  a

Q21.    

To specify the style of line as dashed, which argument of plot() needs to be set?

a)   line

b)   width

c)   style

d)   linestyle

Ans: d)

Q22.    

Which argument in hist() used to create a stacked bar type histogram?

a)   histt

b)   histtype

c)   type

d)   barstacked

Ans: b)

Q23.    

Which argument must be provided to create wedges out of a pie chart?

a)   label

b)   autopct

c)   explode

d)   wedge

Ans: c)

Q24.    

Which argument must be set with plotting functions for legend() to display the legends?

a)   data

b)   label

c)   name

d)   sequence

Ans: b)

Q25.    

Which argument of bar() lets you set the thickness of bar?

a)   thick

b)   thickness

c)   width

d)   barwidth

Ans : c)

Q26.    

Which argument of boxplot is used to create a filled boxplot?

a)   Fill

b)   Box

c)   Patch_artist

d)   Patch

Ans: c)

Q27.    

Which argument should be set to display percentage share of each pie on pie chart?

a)   label

b)   autopct

c)   explode

d)   wedge

Ans: b)

Q28.    

Which function is used to show legends?

a)   display()

b)   show()

c)   legend()

d)   legends()

Ans: c)

Q29.    

Which function to create a boxplot?

a)   Box()

b)   Plot()

c)   Boxplot()

d)   Showbox()

Ans : c)

Q30.    

Which function would you set the title of the plot?

a)   title()

b)   plottile()

c)   graphtitle()

d)   all of these

Ans: a)

Q31.    

Which function would you to set the limits for x-axis of the plot?

a)   limits()

b)   xlimits()

c)   xlim()

d)   lim()

Ans: c)

Q32.    

Which functions is  used to create a histogram?

a)   Histo()

b)   Histogram()

c)   Hist()

d)   Histtype

Ans:c)

Q33.    

Which is a python package used for 2D graphics?

a)   matplotlib.pyplot

b)   matplotlib.pip

c)   matplotlib.numpy

d)   matplotlib.plt

Ans : a

Q34.    

Which key is used to run the module?

a)   F6

b)   F4

c)   F3

d)   F5

Ans :  D

Q35.    

Which of the following function can plot only data series?

a)   Plot()

b)   Bar()

c)   Boxplot()

d)   Pie()

Ans: d)

Q36.    

Which of the following functions is use to create a line chart?

a)   line()

b)   plot()

c)   chart()

d)   plotline()

Ans: b)

Q37.    

Which of the following functions will create a horizontal bar chart?

a)   plot()

b)   bar()

c)   plotbar()

d)   barh()

Ans: d)

Q38.    

Which of the following functions will create a vertical bar chart?

a)   plot()

b)   bar()

c)   plotbar()

d)   barh()

Ans:b)

Q39.    

Which of the following functions will produce bar chart?

a)   plot()

b)   bar()

c)   plotbar()

d)   barv()

Ans: b)

Q40.    

Which of the following is not a valid chart type?

a)   histogram

b)   statistical

c)   Both b) and d)

d)   box

Ans:c)

Q41.    

Which of the following is not valid plotting function of pyplot?

a)           plot()

b)           bar()

c)           line()

d)           pie()

Ans: c)

Q42.    

Which of the following plotting functions does not valid plot multiple data series?

a)           plot()

b)           bar()

c)           pie()

d)           barh()

Ans: c)

Q43.    

Which of the following value is provided by kind keyword for barplot?

a)   Bar

b)   Kde

c)   Hexbin

d)   none of the mentioned

Ans: a

Q44.    

You can create a scatter plot matrix using the __________ method in pandas.tools.plotting.

a)   sca_matrix

b)   scatter_matrix

c)   DataFrame.plot

d)   all of the mentioned

Ans: b


No comments:

Post a Comment