Questions of Matpotlib and Seaborn
Questions of Matpotlib and Seaborn
a) plt.display()
b) plt.show()
c) plt.plot()
d) plt.figure()
Answer: b) plt.show()
2. Which function is used to create a scatter plot in Matplotlib?
a) plt.plot()
b) plt.scatter()
c) plt.bar()
d) plt.line()
Answer: b) plt.scatter()
3. In Seaborn, which function would you use to create a box plot?
a) sns.boxplot()
b) sns.barplot()
c) sns.violinplot()
d) sns.histplot()
Answer: a) sns.boxplot()
4. How can you add a title to a plot in Matplotlib?
a) plt.set_title()
b) plt.add_title()
c) plt.title()
d) plt.text()
Answer: c) plt.title()
5. What is the default style of plots in Seaborn?
a) whitegrid
b) darkgrid
c) ticks
d) classic
Answer: b) darkgrid
6. How do you adjust the size of a figure in Matplotlib?
a) plt.size()
b) plt.figure(figsize=(x, y))
c) plt.adjust_size()
d) plt.set_size()
Answer: b) plt.figure(figsize=(x, y))
7. Which of the following is used to create a histogram in Matplotlib?
a) plt.hist()
b) plt.plot()
c) plt.bar()
d) plt.scatter()
Answer: a) plt.hist()
8. How do you change the color palette in Seaborn?
a) sns.set_palette()
b) sns.set_color()
c) sns.palette()
d) sns.set_color_palette()
Answer: a) sns.set_palette()
9. What function is used to create a line plot in Seaborn?
a) sns.lineplot()
b) sns.scatterplot()
c) sns.barplot()
d) sns.plot()
Answer: a) sns.lineplot()
10. What does the function sns.pairplot() create in Seaborn?
a) Pairwise relationships between variables
b) Distribution of variables
c) A heatmap
d) A bar plot
Answer: a) Pairwise relationships between variables
Conclusion
This collection of 25 MCQs each for Matplotlib and Seaborn covers a broad range of topics that would be useful in
hackathon challenges, ranging from beginner to advanced levels. These questions test practical knowledge and
understanding of data visualization techniques often used during data analysis competitions.
4o mini
You said:
givw me more mcqs
ChatGPT said:
ChatGPT
Certainly! Here are more MCQs on Matplotlib and Seaborn, continuing from the previous ones, to further test your
knowledge.