Est. Reading Time: 10 mins
There are dozens of great python libraries and tools available to Data Scientists that want to create engaging plot and graph visualizations.
From the old guard like Matplotlib to the beautifully crafted newer entrants like PlotAPI, each has unique capabilities, syntax, flexibility, and levels of interactivity.
We think there are seven python libraries in particular that every Data Scientist should know about: Matplotlib, Seaborn, Folium, Bokeh, Plotly, Altair, and PlotAPI.
Choosing the right one depends mainly on what features and capabilities you need and your experience level.
Read on to dig deeper into each library, visualize it, and get the tl;dr on its pros and cons. You'll get all the info you need to select the best library for your next python visualization project.
Interactive data visualization is more engaging
Interactive data visualization is more engaging for stakeholders, without a doubt. But interactive plots can take more time to create.
Decide how interactive you want your plots to be because it will affect the framework you choose.
For instance, Matplotlib and Seaborn are suitable for creating static visualizations that effectively explain concepts in a presentation, paper, or slide deck.
Great to move quickly and get a report or app published and shared, albeit less likely to wow your audience.
On the other hand, Altair, Bokeh, PlotAPI, and Plotly allow for the creation of highly interactive graphs that enable users to explore the data for themselves.
Great to get something beautiful into the hands of your stakeholders, but it may take slightly longer.
Syntax and flexibility matter
You also need to know the syntax of each library and how it aligns with your data and use case.
Lower-level libraries like Matplotlib offer a lot of flexibility, but the API may be more verbose.
On the other hand, libraries like Altair and Seaborn offer more declarative syntax, making it easier to map your data to the visualization.
Select a library aligned with your use case
If you have a specialized use case, like a geographical plot or large data, or a specific plot type, you may want a library tailored to those needs.
For example, Folium is specifically designed for creating geographical plots.
Libraries such as Bokeh and Plotly offer a wide range of plot types and are good for unique visualization needs.
Libraries like PlotAPI supercharge your visuals even more, adding an extra layer of quality to your report or app.
Don't forget the delivery method
When you've chosen a library and built your visualizations, remember to think carefully about how you deliver those insights to colleagues or stakeholders.
Downloading a report as a PDF or screenshotting your notebook is not only underwhelming, but you also lose interactivity and visual quality.
Exporting to HTML, even if you strip your notebook of the code, is better - but you'll need to update it every time you make a change.
Tools like Streamlit and Dash can be great for building and sharing interactive python analysis as a web app but might require learning new skills.
Whilst Datapane lets you convert any notebook into a beautiful, shareable, interactive app from inside Jupyter.
Remember this last step. The format your visualization takes is often as important as the library!
Altair
Altair is a declarative statistical visualization library for Python.
Altair's design means that users can create visualizations by simply "declaring" the links between data columns and visualizations without needing to write complex plotting commands.
Its API is simple, friendly, consistent, and built on top of the powerful Vega-Lite visualization grammar, so it's great for producing beautiful and compelling visualizations with minimal code.

Pros ✅
- Its declarative design makes it relatively easy to create visualizations with minimal code
- As it's built on top of the Vega-Lite grammar, it's powerful and flexible
- It supports various visualizations, from bar and line charts to more complex plots like scatter plots with multiple axes and faceting
- It has several compound plot types that allow you to overlay two different charts on the same set of axes
Cons ❌
- Altair is still a relatively new library, so it may have less community support or fewer third-party packages and extensions than other popular libraries
- Users may need to learn the underlying Vega-Lite system to fully utilize it
- By default, Altair does not support the visualization of large datasets
- Altair does not support 3D plots
Installing Altair
You can install Altair using:
$ pip install altair vega_datasets
$ conda install -c conda-forge altair vega_datasets
See it in action
We built a simple visualization using Altair and Datapane. See its documentation to get started.