Search Your Question...!

Data Visualisation with Matplotlib MCQ's

1. Multiple lines can be plotted using a single plot function? State True or False

   View Answer   

   True



2. Which of the following parameter is used to set the color of a error bar in bar plots?

   View Answer   

   ecolor



3. Which of the following parameter is used to set the style of a line?

   View Answer   

   linestyle



4. A Figure can contain multiple Axes. State true or false.?

   View Answer   

   True



5. What does the function subplot return?

   View Answer   

   Axes object



6. Which of the following function adjusts the subplot params so that subplots fits into figure area?

   View Answer   

   tight_layout()



7. Which of the following parameter is used to set error bars on drawn vertical bars in a bar plot?

   View Answer   

   yerr



8. he expression add_subplot(111) is equivalent to add_subplot(1,1,1). State True or False

   View Answer   

   True



9. Which of the following parameter is used to set the background of subplot?

   View Answer   

   axisbg



10. What does the pyplot method, subplots return?

   View Answer   

   A figure and list of axes



11. Which parameter is used to set a Main title for a figure with multiple plots?

   View Answer   

   main_title



12. What is the extension of a matplotlib style sheet?

   View Answer   

   mplstyle



13. Which of the following functions is used to locate the matplotlib config directory ?

   View Answer   

   matplotlib.get_configdir



14. For applying different settings from default one to many plots, which of the following is the best suited one?

   View Answer   

   To make changes in matplotlibrc file



15. Which of the following expressions list the names of styles associated with matplotlib ?

   View Answer   

   plt.style.available



16. Which of the following dictionary stores all the settings present in a matplotlibrc file?

   View Answer   

   rcParams



17. Two or mor styles can be composed. State true or false.

   View Answer   

   True



18. Which of the following functions assisting in specifying the style sheets to be used ?

   View Answer   

   both



19. Which of the following expression returns location of matplotlibrc file?

   View Answer   

   matplotlib.matplotlib_fname



20. Which of the following parameter need to be set to increase or decrease the number of outliers ?

   View Answer   

   whis



21. Which of the following parameter is used to change the position of boxplots?

   View Answer   

   position



22. What does the function hist return ?

   View Answer   

   all



23. What happens when a list of values, corresponding to multiple distributions , is passed as input to hist function?

   View Answer   

   In each bin, you will see bars correpsonding to different distributions



24. What does notches represent in a boxplot ?

   View Answer   

   Confidence interval around the median



25. Which of the following parameter is used to set the symbol for points lying after whisker?

   View Answer   

   sym



26. Inter Quartile Range is ___?

   View Answer   

   Q3-Q1



27. Which of the following parameter is used to set to draws bars of histogram horizontally?

   View Answer   

   orientation



28. What is the purpose for which linewidth parameter is used in a bar function?

   View Answer   

   For specifying width of edges, drawn on bars



29. Which of the following functions is used to create horizontal bar plots?

   View Answer   

   barh



30. Which of the following value need to be provided for align argument, if bars need to be aligned on left side, in case of bar function?

   View Answer   

   edge



31. Which of the following parameter is used to set the direction of drawing fractions, in a pie plot?

   View Answer   

   CounterClock



32. Which of the following parameter is used to draw shadow behind the pie plot?

   View Answer   

   Shadow



33. Which of the following parameter is used to make a line disappear, when plotted using plot function?

   View Answer   

   visible



34. Which of the following parameter is used to set the size of marker , while using plot function?

   View Answer   

   markersize



35. Which of the following value creates triangle markers, pointing left wards?

   View Answer   

   <



36. What does the expression plot(x, y, 'bo') do ?

   View Answer   

   Plots blue colored circle markers



37. What is the default width and height of a matplotlib figure , in inches?

   View Answer   

   6,4



38. An Axes can be associated with multiple Figures. State true or false.?

   View Answer   

   False



39. The function add_subplot returns ___?

   View Answer   

   Axes



40. The area where data is plotted is known as ___________.

   View Answer   

   Axes



41. Which of the following parameter need to be set mandatorily, for plot function to create a legend?

   View Answer   

    label



42. Which of the following argument to set function, is used for labelling ticks on X- Axis?

   View Answer   

   xticklabels



43. Which of the following python libraries are used for Data Visualization?

   View Answer   

   All of those mentioned



44. What is the expected output of the following code?
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
plt.plot([10, 12, 14, 16])
plt.show()

   View Answer   

   A line passing through points : (0, 10), (2, 14)



45. Which of the following statements is correct, based on figure generated with below code?
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, title="My Plot")
x = [0, 1, 2, 3, 4]
y = [0, 3, 6, 9, 12]
plt.scatter(x, y, s=[20, 60], c=['r', 'g'])
plt.show()

   View Answer   

   error



46. How many rows does plot1 occupy in the figure, plotted using below code?
axes1 = plt.subplot(2, 2, (1,3), title='Plot1')
axes2 = plt.subplot(2, 2, 2, title='Plot2')
axes3 = plt.subplot(2, 2, 4, title='Plot3')
plt.show()

   View Answer   

   2



47. How many subplots occupy two rows and one column in the figure, plotted using below code?
import matplotlib.gridspec as gridspec
fig = plt.figure()
gs = gridspec.GridSpec(3, 3)
ax1 = plt.subplot(gs[0, :])
ax2 = plt.subplot(gs[1, :-1])
ax3 = plt.subplot(gs[1:, -1])
ax4 = plt.subplot(gs[-1, 0])
ax5 = plt.subplot(gs[-1, -2])
plt.show()

   View Answer   

   1



48. How many subplots occupy two rows in the figure, generated using below code?
import matplotlib.gridspec as gridspec
fig = plt.figure()
gs = gridspec.GridSpec(3, 3)
ax1 = plt.subplot(gs[:2, :2])
ax2 = plt.subplot(gs[0, 2])
ax3 = plt.subplot(gs[1, 2])
ax4 = plt.subplot(gs[-1, 0])
ax5 = plt.subplot(gs[-1, 1:])
plt.show()

   View Answer   

   1



No comments:

Post a Comment