Daily Reading 14
Data Visualization
###
What are the key differences between Matplotlib, Seaborn, and Bokeh libraries in terms of their features and use cases? Provide an example of a specific visualization that is more suitable for each library.
Bokeh is explicitly made for creating interactive charts, whether it be from tooltips appearing to provide more information when mouse hovering over specific elements, or changing the input values of a sine wave via sliders, and thus should be considered for any charts or plots where active user input is used or encouraged. If you want the user to be able to “play” with the data.
Seaborn and Matplotlib are closer in similarity (due to Seaborn being a system that relies on the installation of Matplotlib in the first place), but seaborn’s focus is more on simple input and minimal code to make meaningful and pretty graphs of numerous varieties, while matplotlib is more code-heavy, but is capable of more advanced customization and specificity. Seaborn is a sort of Simplifier, for matplotlib.
In the Seaborn library, what are the main functions to create relational, categorical, and distribution plots? Briefly explain the purpose of each type of plot and provide an example use case.
A categorical plot can be made using sns.factorplot(xlabel, ylabel, hue, INPUTDATA)
a distribution plot can be made using sns.displot()
or sns.histplot()
, though note that the former method of sns.distplot()
has be deprecated.
sns.swarmplot(x="x axis label", y="y axis label" data={INPUTDATA})
The above, assuming imports of matplotlib and seaborn are accounted for, is all that is needed for getting a scatter plot(or swarm as it is named here) displaying. Numerous default settings are already handled for you, with a focus on being aesthetically pleasing with minimal modification by the programmer.
Discuss the role of the Seaborn Cheat Sheet in a Python developer’s workflow. What are some key sections or elements featured in the cheat sheet that can help a developer quickly reference Seaborn functionalities?
A cheatsheet is useful for being able to look over and know the exact formatting required for getting seaborn and matplotlib properly installed into your project, and the basic forms of each of the most common plot types are provided, along with a couple common arguments for you to use in your contexts. Cheatsheets as a whole are for quick reference, to have at your side for at-a-glance debugging and reminders for how the particular library/codebase/system you’re working in functions.