Introducing Seaborn Objects: One Ring to Rule Them All! – Towards Data Science

Quick Success Data Science One plotting ring to rule them all! One ring to Plot them all (by Dall-E2)

Have you started using the new Seaborn Objects System for plotting with Python? You definitely should; its a wonderful thing.

Introduced in late 2022, the new system is based on the Grammar of Graphics paradigm that powers Tableau and Rs ggplot2. This makes it more flexible, modular, and intuitive. Plotting with Python has never been better.

In this Quick Success Data Science project, youll get a quick start tutorial on the basics of the new system. Youll also get several useful cheat sheets compiled from the Seaborn Objects official docs.

Well use the following open-source libraries for this project: pandas, Matplotlib, and seaborn. You can find installation instructions in each of the previous hyperlinks. I recommend installing these in a virtual environment or, if youre an Anaconda user, in a conda environment dedicated to this project.

The goal of Seaborn has always been to make Matplotlib Pythons primary plotting library both easier to use and nicer to look at. As part of this, Seaborn has relied on declarative plotting, where much of the plotting code is abstracted away.

The new system is designed to be even more intuitive and to rely less on difficult Matplotlib syntax. Plots are built incrementally, using interchangeable marker types. This reduces the number of things you need to remember while allowing for a logical, repeatable workflow.

The use of a modular approach means you dont need to remember a dozen or more method names like barplot() or scatterplot() to build plots. Every plot is now initiated with a single Plot() class.

The Plot() class sets up the blank canvas for your graphic. Enter the following code to see an example (shown using JupyterLab):

Original post:

Introducing Seaborn Objects: One Ring to Rule Them All! - Towards Data Science

Related Posts

Comments are closed.