Music
Hi everyone and welcome to another episode of Data and AI with Mukundan.
The show where we dive deep into the world of data science, artificial intelligence and everything in between.
I am your host Mukundan Sankar and today we are unlocking a treasure chest of data visualization secrets.
Let me ask you this, have you ever created a chart that looks ok but doesn't quite pop?
Or maybe you have shown a graph to your team and their eyes glaze over but you know it's just that because it doesn't tell the story quite clearly.
Well if you are nodding along, today's episode is just for you.
I am about to reveal nine hidden or I guess less spoken about plotly tricks.
Plotly is a Python data visualization library which can take your visuals from ordinary to extraordinary.
Whether you are a seasoned data scientist or just starting out, these techniques will help you make a long lasting impression.
So let's get started.
So before I dive into the techniques, let's talk about why plotly is a game changer.
So unlike traditional libraries like Matplotlib or Seaborn, which I am sure you are familiar with if you are using Python data visualization,
Plotly specializes in creating interactive and dynamic visualizations.
It's perfect for storytelling because it allows you to add layers of interaction and depth.
But here's the thing, most people only scratch the surface so what it can do,
they stick to basic bar charts or scatter plots and miss out on the powerful features which are hidden below the surface.
And that's what we are here to explore today.
So let me talk about nine hidden plotly tricks which is something that you would want to use for your data visualization task while you are presenting it to your business stakeholders.
Alright, so let's dive into these tricks.
I'll break down each one of them for you, explain why it's considered hidden
and how you can use it to unlock deeper insights from your data.
First up, we have the custom pairwise correlation matrix.
This is a staple for understanding feature relationships.
Now, most people, they create basic heat maps, but you, you can make them far more informative by adding annotations and custom color scales.
So I've used real world data and I have a notebook where I've done these hidden tips so that you can use them as well.
So you can have a look at this notebook and it has all these nine hidden tips.
But I'm just going to talk through the notebook and obviously you can just use the link in the show notes to actually look at what data I've used and how the visuals actually come through.
Right, so for my use case, I've used data sets from UCI machine learning repository.
So this is basically, if you're not familiar with UCI machine learning repository, it's this machine learning data set repository from University of California Irvine.
They've been providing data sets for anybody who's starting out in the field of data science.
So if you are just starting out, you may not as be familiar, if you're seasoned, I'm sure you are definitely familiar with this.
But again, so the links to whichever data sets I've used are there in the code in the notebook, which I've linked in the show notes.
So the first one for what I used here was the wine quality data set.
And in this, I use this technique to highlight how alcohol levels correlate with the wine quality.
So why this matters is stakeholders, they can see instantly which features drive the outcomes that they care about.
And similarly for whatever task that you're working on, right, I mean, you can use like annotations to highlight something which you want your stakeholder to look at.
The second thing I wanted to look at was like a dynamic data highlight.
So this is like a conditional formatting in Excel, except think about Excel conditional formatting on steroids.
For instance, you can highlight wines with high alcohol and low pH, which are the key markers, which are the key markers of premium quality.
This technique simplifies analysis for decision makers.
The third thing I wanted to talk about was density contours for class distribution.
Now, have you ever felt like scatter plots don't quite tell the whole story?
Adding density contours can show you where the data clusters and overlaps.
I use this to visualize the separability of species in the Iris data set.
It's a fantastic way to evaluate classic models visually.
The fourth thing I talk about was faceted histograms.
Now faceted histograms lets you break down data into subgroups.
For example, I've used the car evaluation data set where I created facets to compare buying prices by the class.
Now it's like getting multiple charts in one view, which is incredibly useful for comparing categories.
The fifth thing I talked about was adding threshold lines.
Now threshold lines are perfect for emphasizing decision boundaries.
I've used a blood donation data set here where I've added a line to show the critical recency threshold for donors.
Now it's an easy way to draw attention to actionable insights, and that's why adding threshold lines is.
Is very hidden and very important.
Is very important.
Custom annotations.
So custom annotations transform your visuals into storytelling tools.
Now in the car evaluation data set, I use annotations to label the cheapest car options.
This simple addition makes the chart immediately actionable for consumers.
3D scatter plots.
Now sometimes you're looking at data and 2D just doesn't cut it right?
With 3D scatter plots, you can uncover relationships that are invisible in two dimensions.
For example, I use the Iris data set to visualize class separability in three dimensions, thereby revealing patterns that I've missed otherwise.
Tip number eight.
It's animated visualizations. Animations, they can show how data evolves over time.
Using the energy efficiency data set, I created an animated plot to visualize how compactness and surface area influence heating and cooling over time.
And surface area influence heating and cooling over time.
It's a powerful way to reveal dynamic patterns.
And finally, the last step is ironically custom tooltips.
So instead of static charts, tooltips let users interact with your visuals.
So for this, I used the adult income data set where I added age, education and income class to the tooltip, making the chart far more engaging and informative.
So I chose multiple data sets because I wanted to give some variety to this.
But obviously you can just use one and just play around with it.
Yeah, so those were like nine tips I had.
But now you wanted to be wondering how can I use this in the real world?
Like how do I apply these tricks to my work?
Let's look at some real world scenarios.
So in business intelligence, you can highlight key trends in sales or customer churn data using dynamic highlights.
Scientific research, if you're in that, you can use density contours to understand clustering in biological data sets.
And in education, you can use threshold lines which can help teachers identify at risk students based on the performance metrics.
Now, these techniques aren't just about creating prettier visuals.
They're about drawing actionable insights and telling compelling stories with your data.
So if these techniques spark your curiosity, don't just stop here.
Head over to my blog post and the notebook, which I mentioned in the show notes for the full code examples and step by step guides.
I've linked all the data sets from the UCI machine learning library in the notebook.
So you can try these tricks.
You can try these tricks for yourself.
And if you found today's episode valuable, please subscribe and leave a review.
Your support helps us bring you more episodes like this one.
Finally, let me know in the comments or on social media.
Which of these tricks are you most excited to try?
Or if you've already used them, I'd love to hear more about your experiences.
Thanks for tuning in to Data and AI with Mukundan.
Remember the next time you create a chart, don't just settle for the ordinary.
Use these tricks to make your visuals extraordinary.
Until next time, keep exploring, keep experimenting and keep pushing the boundaries of what's possible with data.