Data Visualization? A Complete Collection of Graphs & Their Python Codes

Honghao Yu
3 min readNov 16, 2020

References:

https://mode.com/blog/python-data-visualization-libraries/

https://towardsdatascience.com/top-6-python-libraries-for-visualization-which-one-to-use-fe43381cd658

https://blog.ine.com/python-visualization-libraries-you-should-know-in-2020-and-how-to-use-them

https://www.anaconda.com/blog/python-data-visualization-2018-why-so-many-libraries

Python Visualization Packages by Type
Python’s Visualization Packages and Their Roots

Before we dive deep into the packages, it might be helpful if we familiarize ourselves with Datapane, a Python framework and API for publishing and sharing Python reports. We can use it to organize and publish our visualizations and related analyses. Here is one of its many impressive examples:

As we can see in the opening graphs, there are just so many packages and so many charts to choose from when extracting information from data through visualization. It may save a lot of time and trouble if we summarize the major features and usages of the packages and the available charts all in this article so that we can quickly find the right package(s) in the future depending on our needs!

First of all, I would like to provide a comprehensive list of the most commonly used packages in alphabetical order:

  1. Altair
  2. Bokeh
  3. Cartopy
  4. Dash
  5. Folium (geo/maps)
  6. geoplotlib (geo/maps)
  7. ggplot
  8. Gleam
  9. Leather
  10. Matplotlib
  11. missingno
  12. Networkx (networks)
  13. Plotly
  14. pygal
  15. Seaborn

I’ve taken a rough look at each package and grouped them by their feature as below:

Easy-to-use: Altair, ggplot, Leather, missingno, Seaborn

Good Style & Design: Plotly, Seaborn

Web-friendly: Bokeh, Gleam

High Flexibility: Bokeh

High Chart Diversity: Plotly

Note that this grouping is very objective and is subject to change. It only serves as a suggestion by the aggregate opinions of the practitioners.

Next, we shall investigate what can be visualized. Fancy, informative, and straightforward as it might look, visualization is not for everything. Intuitively, we can visualize magnitude, 2-D relationships, etc. Here I will try to provide a comprehensive list of the subjects that are suitable for visualizing.

[To be done]

We have known what information can be visualized, but it’s not enough. Different charts convey different messages, so it’s important to know all the available charts and choose the most relevant one.

SciVis (with Plotly):

  1. ML Regression: Linear regression line, 3D regression surface, coefficients, prediction error plots, residual plots, regularization, grid-search heatmap; force plot (SHAP), etc.
  2. KNN Classification: contour plot, multiclass heatmap
  3. ROC and PR Curves: binary ROC curve, multiclass ROC curve, precision-recall curves
  4. PCA Visualization: original dimensions, principal components, 2D PCA scatter plot, explained variance plot, loadings

InfoVis:

  1. Basic stats for 1D: bar chart, pie chart
  2. Basic stats for 2D/higher dimensions: heatmap, bubble chart, Parallel Categories Diagram (categorical data)
  3. Distribution: 1D/2D histogram, (trellis) scatter plot, bubble chart, faceted density chart/ridgeline plot, boxplot, stem plot, violin plot, distplots, dot-dash plots (marginal distribution), marginal distribution plots, QQ plot (comparing two distributions), Wilkinson Dot Plot,
  4. Trends/Time Series: line chart, step chart, slope chart, (stacked/trellis) area chart, strip chart (streaming data), streamgraph, candlestick chart (finance), Wilkinson Dot Plot, Linear & Non-Linear Trendlines, OHLC Chart (finance), Indicators (finance),
  5. (Work)flow Management: Gantt Chart, Sankey Diagram,
  6. Network: Network Graph,
  7. Hierarchy: sunburst chart, treemap chart, tree plot (decision flow), funnel chart,
  8. Others: Becker’s Barley Trellis Plot, Error Bars (variability of data), Continuous Error Bands (extension to Error Bars), waterfall chart (cumulative effect), gauge chart (scale/range), bullet chart (variation of gauge chart)

GeoVis:

  1. Choropleth Map

--

--

Honghao Yu

Product Manager at TikTok | MSc. Data Science for Business at École Polytechnique & HEC Paris