×

Multiple-Choice Questions

Web Technologies MCQs

Computer Science Subjects MCQs

Databases MCQs

Programming MCQs

Testing Software MCQs

Digital Marketing Subjects MCQs

Cloud Computing Softwares MCQs

AI/ML Subjects MCQs

Engineering Subjects MCQs

Office Related Programs MCQs

Management MCQs

More

Seaborn MCQs (Multiple-Choice Questions)

Seaborn is a Python data visualization library built on top of Matplotlib. It provides a high-level interface for creating attractive and informative statistical graphics and supports relational, distributional, categorical, regression, and matrix visualizations.

Seaborn MCQs

This section contains Seaborn Multiple-Choice Questions with Answers. These Seaborn MCQs cover important concepts such as plotting functions, statistical visualization, categorical plots, distribution plots, regression plots, heatmaps, color palettes, themes, and multi-plot grids. Practice these MCQs to test and improve your knowledge of Seaborn.

List of Seaborn MCQs

The following are the popular MCQs on Seaborn:

1. What is Seaborn primarily used for?

  1. Web application development
  2. Statistical data visualization
  3. Database administration
  4. Operating system programming

Answer: B) Statistical data visualization

Explanation:

Seaborn is a Python library designed for statistical data visualization. It provides a high-level interface for creating informative and attractive graphics and is built on top of Matplotlib.

2. Seaborn is built on top of which Python visualization library?

  1. Plotly
  2. Bokeh
  3. Matplotlib
  4. TensorFlow

Answer: C) Matplotlib

Explanation:

Seaborn is built on top of Matplotlib. It provides a higher-level interface while still working with Matplotlib figures and axes.

3. Which statement is commonly used to import Seaborn?

  1. import seaborn as sns
  2. import sns as seaborn
  3. from python import seaborn
  4. include seaborn

Answer: A) import seaborn as sns

Explanation:

The conventional import statement for Seaborn is:

import seaborn as sns

The alias sns is commonly used when calling Seaborn functions.

4. Which Seaborn function is used to create a scatter plot?

  1. sns.scatterplot()
  2. sns.scatter()
  3. sns.pointscatter()
  4. sns.xyplot()

Answer: A) sns.scatterplot()

Explanation:

The sns.scatterplot() function creates a scatter plot and can use semantic variables such as hue, size, and style to represent additional dimensions.

5. Which Seaborn function is used to create a line plot?

  1. sns.linechart()
  2. sns.lineplot()
  3. sns.plotline()
  4. sns.lines()

Answer: B) sns.lineplot()

Explanation:

The sns.lineplot() function is used to draw line plots. It is particularly useful for visualizing relationships involving continuous variables and trends.

6. Which Seaborn function is used to create a histogram?

  1. sns.histplot()
  2. sns.histogram()
  3. sns.distribution()
  4. sns.hist()

Answer: A) sns.histplot()

Explanation:

The sns.histplot() function is used to visualize the distribution of data using a histogram. It can also be used for bivariate histograms.

7. Which Seaborn function creates a kernel density estimate plot?

  1. sns.density()
  2. sns.kdeplot()
  3. sns.kernelplot()
  4. sns.densityplot()

Answer: B) sns.kdeplot()

Explanation:

The sns.kdeplot() function creates a kernel density estimate plot that represents the distribution of observations using a smoothed density curve.

8. Which function is used to create a box plot in Seaborn?

  1. sns.boxplot()
  2. sns.boxchart()
  3. sns.plotbox()
  4. sns.distributionbox()

Answer: A) sns.boxplot()

Explanation:

The sns.boxplot() function creates a box plot that can be used to visualize the distribution of numerical data across categories.

9. Which Seaborn function creates a violin plot?

  1. sns.violinplot()
  2. sns.violin()
  3. sns.distribution_violin()
  4. sns.violinchart()

Answer: A) sns.violinplot()

Explanation:

The sns.violinplot() function displays the distribution of numerical data across categories using a violin-shaped representation.

10. Which function is used to create a bar plot in Seaborn?

  1. sns.barplot()
  2. sns.barchart()
  3. sns.columnplot()
  4. sns.bargraph()

Answer: A) sns.barplot()

Explanation:

The sns.barplot() function creates categorical bar plots and displays point estimates with error bars by default.

11. Which function is used to display the count of observations in each categorical bin?

  1. sns.countplot()
  2. sns.frequencyplot()
  3. sns.categorycount()
  4. sns.observationplot()

Answer: A) sns.countplot()

Explanation:

The sns.countplot() function displays the number of observations in each category using bars.

12. Which function creates a strip plot in Seaborn?

  1. sns.stripplot()
  2. sns.pointstrip()
  3. sns.stripchart()
  4. sns.categoryscatter()

Answer: A) sns.stripplot()

Explanation:

The sns.stripplot() function creates a categorical scatterplot. Jitter can be used to reduce overlap between points.

13. Which Seaborn function creates a categorical scatter plot with non-overlapping points?

  1. sns.swarmplot()
  2. sns.scattercategory()
  3. sns.categoryswarm()
  4. sns.dotplot()

Answer: A) sns.swarmplot()

Explanation:

The sns.swarmplot() function creates a categorical scatter plot in which points are adjusted to reduce overlap.

14. Which function is used to create a point plot?

  1. sns.pointplot()
  2. sns.pointchart()
  3. sns.dotplot()
  4. sns.categorypoint()

Answer: A) sns.pointplot()

Explanation:

The sns.pointplot() function displays point estimates and uncertainty using points connected by lines.

15. Which function is used to create a boxen plot?

  1. sns.boxenplot()
  2. sns.enhancedbox()
  3. sns.boxplot2()
  4. sns.largeboxplot()

Answer: A) sns.boxenplot()

Explanation:

The sns.boxenplot() function creates an enhanced box plot designed to show more information about distributions, particularly with larger datasets.

16. Which function creates a heatmap in Seaborn?

  1. sns.heatmap()
  2. sns.heatplot()
  3. sns.colormap()
  4. sns.matrixheat()

Answer: A) sns.heatmap()

Explanation:

The sns.heatmap() function represents rectangular data as a color-encoded matrix. It is commonly used for correlation matrices and other tabular data.

17. Which Seaborn function creates a hierarchically clustered heatmap?

  1. sns.clustermap()
  2. sns.clusterheatmap()
  3. sns.hierarchicalmap()
  4. sns.clusterplot()

Answer: A) sns.clustermap()

Explanation:

The sns.clustermap() function creates a matrix visualization with hierarchical clustering applied to the rows and columns.

18. Which function is used to create a regression plot with a fitted linear model?

  1. sns.regplot()
  2. sns.linearplot()
  3. sns.regression()
  4. sns.fitplot()

Answer: A) sns.regplot()

Explanation:

The sns.regplot() function plots data and fits a linear regression model to show the relationship between two variables.

19. Which Seaborn function creates a regression plot across a FacetGrid?

  1. sns.lmplot()
  2. sns.reggrid()
  3. sns.lineargrid()
  4. sns.modelplot()

Answer: A) sns.lmplot()

Explanation:

The sns.lmplot() function provides a figure-level interface for plotting data and regression model fits across a FacetGrid.

20. Which function is used to visualize residuals from a regression model?

  1. sns.residplot()
  2. sns.residuals()
  3. sns.errorplot()
  4. sns.regresid()

Answer: A) sns.residplot()

Explanation:

The sns.residplot() function displays residuals from a linear regression model, helping visualize how well the model describes the relationship in the data.

21. Which function creates a pairwise relationship plot for variables in a dataset?

  1. sns.pairplot()
  2. sns.pairwiseplot()
  3. sns.relationships()
  4. sns.multiplot()

Answer: A) sns.pairplot()

Explanation:

The sns.pairplot() function creates a grid showing pairwise relationships between variables in a dataset.

22. Which function creates a plot showing the relationship between two variables along with their marginal distributions?

  1. sns.jointplot()
  2. sns.pairplot()
  3. sns.marginplot()
  4. sns.bivariateplot()

Answer: A) sns.jointplot()

Explanation:

The sns.jointplot() function visualizes the relationship between two variables while also displaying their individual distributions along the margins.

23. Which function provides a figure-level interface for relational plots?

  1. sns.relplot()
  2. sns.relationplot()
  3. sns.relgraph()
  4. sns.relationship()

Answer: A) sns.relplot()

Explanation:

sns.relplot() is a figure-level interface for relational plots. It can create scatter or line plots through its kind parameter.

24. Which kind of plot is the default for sns.relplot()?

  1. Bar plot
  2. Scatter plot
  3. Heatmap
  4. Box plot

Answer: B) Scatter plot

Explanation:

The default value of the kind parameter in sns.relplot() is "scatter". A line plot can be selected with kind="line".

25. Which parameter can be used with relplot() to create a line plot?

  1. type="line"
  2. kind="line"
  3. plot="line"
  4. style="line"

Answer: B) kind="line"

Explanation:

The kind parameter determines the type of relational plot. Setting kind="line" creates a line plot.

sns.relplot(data=data, x="x", y="y", kind="line")

26. Which function provides a figure-level interface for distribution plots?

  1. sns.displot()
  2. sns.distplot()
  3. sns.distributionplot()
  4. sns.distgraph()

Answer: A) sns.displot()

Explanation:

sns.displot() is the figure-level interface for distribution plots. It can be used with different plot kinds, including histograms and KDE plots.

27. Which function provides a figure-level interface for categorical plots?

  1. sns.catplot()
  2. sns.categoryplot()
  3. sns.catgraph()
  4. sns.categorical()

Answer: A) sns.catplot()

Explanation:

sns.catplot() provides a figure-level interface for categorical visualizations. It can create several categorical plot types through its kind parameter.

28. Which of the following is a valid kind for sns.catplot()?

  1. box
  2. matrix
  3. heat
  4. regression

Answer: A) box

Explanation:

sns.catplot() supports several categorical plot types, including box, violin, bar, strip, swarm, and others.

29. Which parameter is used to map a variable to color in many Seaborn plots?

  1. colorby
  2. hue
  3. shadeby
  4. color_map

Answer: B) hue

Explanation:

The hue parameter maps a variable to color. It can be used to distinguish different categories or represent numeric values through a color scale.

30. Which parameter can control the size of points according to a variable in a scatter plot?

  1. size
  2. pointsize
  3. scale
  4. markersize_only

Answer: A) size

Explanation:

The size parameter can map a variable to the size of points in functions such as scatterplot().

31. Which parameter can be used to vary marker style based on a variable?

  1. marker_style
  2. style
  3. shape
  4. symbol

Answer: B) style

Explanation:

The style parameter maps a variable to different marker styles. This can provide an additional visual distinction between groups.

32. Which parameter specifies the color palette used for semantic mappings?

  1. palette
  2. colorset
  3. color_scheme
  4. theme_colors

Answer: A) palette

Explanation:

The palette parameter controls the colors used for semantic variables such as hue.

33. Which Seaborn function is used to set the overall visual theme?

  1. sns.set_theme()
  2. sns.theme()
  3. sns.apply_theme()
  4. sns.visual_theme()

Answer: A) sns.set_theme()

Explanation:

The sns.set_theme() function configures the visual theme for Seaborn and Matplotlib plots.

sns.set_theme(style="whitegrid")

34. Which function is used to set the style of Seaborn plots?

  1. sns.set_style()
  2. sns.style()
  3. sns.apply_style()
  4. sns.plot_style()

Answer: A) sns.set_style()

Explanation:

The sns.set_style() function sets the parameters that control the general appearance and style of Seaborn plots.

35. Which of the following is a valid Seaborn style?

  1. whitegrid
  2. gridonly
  3. lightmatrix
  4. simplegrid

Answer: A) whitegrid

Explanation:

whitegrid is one of the built-in Seaborn styles. Other standard styles include darkgrid, white, dark, and ticks.

36. Which function controls the scaling of plot elements such as labels and lines?

  1. sns.set_context()
  2. sns.set_scale()
  3. sns.plot_scale()
  4. sns.context_size()

Answer: A) sns.set_context()

Explanation:

The sns.set_context() function controls the scaling of plot elements such as fonts, lines, and other visual components.

37. Which function is used to create a color palette in Seaborn?

  1. sns.color_palette()
  2. sns.create_palette()
  3. sns.make_colors()
  4. sns.palette_create()

Answer: A) sns.color_palette()

Explanation:

The sns.color_palette() function returns a list of colors or a continuous colormap that can be used for plotting.

38. Which function sets the Matplotlib color cycle using a Seaborn palette?

  1. sns.set_palette()
  2. sns.apply_palette()
  3. sns.use_palette()
  4. sns.palette_cycle()

Answer: A) sns.set_palette()

Explanation:

The sns.set_palette() function changes the color cycle used by Matplotlib to a specified Seaborn palette.

39. Which function removes the top and right axes spines by default?

  1. sns.despine()
  2. sns.remove_spines()
  3. sns.clear_axes()
  4. sns.hide_axes()

Answer: A) sns.despine()

Explanation:

The sns.despine() function removes selected axis spines from plots. By default, it removes the top and right spines.

40. Which function loads one of Seaborn's example datasets?

  1. sns.load_dataset()
  2. sns.import_dataset()
  3. sns.get_dataset()
  4. sns.read_dataset()

Answer: A) sns.load_dataset()

Explanation:

The sns.load_dataset() function provides access to Seaborn's example datasets, such as the tips, penguins, and flights datasets.

41. Which statement correctly loads the Seaborn tips dataset?

  1. df = sns.load_dataset("tips")
  2. df = sns.get_dataset("tips")
  3. df = sns.read_dataset("tips")
  4. df = sns.import_data("tips")

Answer: A) df = sns.load_dataset("tips")

Explanation:

The load_dataset() function can be used to load Seaborn's example datasets. For example:

df = sns.load_dataset("tips")

42. Which Seaborn function reports the names of available example datasets?

  1. sns.get_dataset_names()
  2. sns.list_datasets()
  3. sns.datasets()
  4. sns.available_data()

Answer: A) sns.get_dataset_names()

Explanation:

The sns.get_dataset_names() function reports the names of the example datasets available through Seaborn's dataset repository.

43. Which Seaborn function can visualize pairwise relationships using multiple subplots?

  1. sns.pairplot()
  2. sns.pairmap()
  3. sns.multirelation()
  4. sns.relationship_grid()

Answer: A) sns.pairplot()

Explanation:

sns.pairplot() creates a grid of plots showing pairwise relationships among variables in a dataset.

44. Which class provides a grid for plotting conditional relationships in Seaborn?

  1. sns.FacetGrid
  2. sns.RelationGrid
  3. sns.ConditionGrid
  4. sns.PlotGrid

Answer: A) sns.FacetGrid

Explanation:

sns.FacetGrid provides a multi-plot grid that can be used to visualize subsets of data based on one or more categorical variables.

45. Which class is used to construct a grid for pairwise relationships?

  1. sns.PairGrid
  2. sns.PairwiseGrid
  3. sns.RelationGrid
  4. sns.MultiPairGrid

Answer: A) sns.PairGrid

Explanation:

sns.PairGrid provides a flexible grid for drawing pairwise relationships between variables in a dataset.

46. Which Seaborn function can be used to display a cumulative distribution function?

  1. sns.ecdfplot()
  2. sns.cdfplot()
  3. sns.cumulativeplot()
  4. sns.distribution_cdf()

Answer: A) sns.ecdfplot()

Explanation:

The sns.ecdfplot() function creates an empirical cumulative distribution function plot.

47. Which function creates a rug plot in Seaborn?

  1. sns.rugplot()
  2. sns.rug()
  3. sns.datapoints()
  4. sns.tickplot()

Answer: A) sns.rugplot()

Explanation:

The sns.rugplot() function draws small marks along an axis to show the marginal distribution of observations.

48. Which parameter can be used in sns.heatmap() to display numerical values inside cells?

  1. annot
  2. label_values
  3. show_values
  4. display_data

Answer: A) annot

Explanation:

The annot parameter in sns.heatmap() can be set to True to display numerical values inside the heatmap cells.

sns.heatmap(data, annot=True)

49. Which function can be used to move a Seaborn legend to another location?

  1. sns.move_legend()
  2. sns.change_legend()
  3. sns.reposition_legend()
  4. sns.legend_position()

Answer: A) sns.move_legend()

Explanation:

The sns.move_legend() function recreates a plot's legend at a specified location.

50. Which statement correctly creates a simple scatter plot using Seaborn?

  1. sns.scatterplot(data=df, x="age", y="income")
  2. sns.scatter(data=df, x="age", y="income")
  3. sns.plot_scatter(df, "age", "income")
  4. sns.scattergraph(df, "age", "income")

Answer: A) sns.scatterplot(data=df, x="age", y="income")

Explanation:

The sns.scatterplot() function accepts a data source and identifies the variables to plot through parameters such as x and y.

sns.scatterplot(data=df, x="age", y="income")
Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2026 www.includehelp.com. All rights reserved.