Python Friday #192: Plotly-Specific Diagrams

Last week we figured out how we can create our well-known plots with Plotly. In this post we explore the diagrams that are specific to Plotly and may help us to find another approach to visualise our data.

This post is part of my journey to learn Python. You find the code for this post in my PythonFriday repository on GitHub.

 

Scatter matrix

With the method scatter_matrix() we can create something like a pair plot in Seaborn:

This gives us a scatter plot for each of the specified dimensions nicely arranged in a 4 by 4 grid:

We get a 4x4 matrix of scatter plots for our data.

 

Sunburst chart

With the method sunburst() we can turn multi-dimensional data into a specialised pie chart:

We can see the days and how the tips are distributed between male and female waiters:

After a first pie chart for the days, we get another ring with the distribution of the tips by gender.

 

Treemap chart

With the treemap() method we can get a treemap of our multi-dimensional data and see at one glance the size distribution of the values:

With the help of the GraphObjects methods we can get the tips data into a readable treemap:

Our tips data set as a treemap.

 

Icicle chart

With the icicle() method we can turn our multi-dimensional data into rectangles and then deep-dive through the dimensions in a so-called icicle chart https://plotly.com/python/icicle-charts/ :

This gives us a first rectangle for the total sum of all bills, then separates into days, time, and the gender of the waiter:

A bit like a treemap when it comes to the size of the objects, but in a more separated way where we can get the total of each type as its own rectangle.

 

Next

With the Plotly-specific plots we can visualize data in an original way that may help us to spot interesting patterns quickly. Next week we explore the different colours we can use with Plotly.

1 thought on “Python Friday #192: Plotly-Specific Diagrams”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.