Python Data Visualization Transcripts
Chapter: Plotly
Lecture: Customizing

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now go through some examples of how we can customize our visualization. The first thing I want to talk about our templates.
0:07 So I'm gonna do the hissed a gram that we did before. But I'm gonna add this variable template equals plotly white and now you can see
0:16 that I have a very different background and look so compare this to this one.
0:22 So we've got a whole different look just by specifying a different template. So if we wanted to, let's say try Seaborn,
0:33 it gives you a visualization that's reminiscent of your seaborn plots,
0:37 but you have the full interactivity that we have learned to appreciate and plotly you
0:44 can refer to the documentation for all the different template options but this is a really good way to control the visualization of your plotly
0:52 plots as we discussed with Seaborn and some of the other tools using colors is really
0:58 important. So one of the things you can do with with plotly is generate
1:03 these swatches of the colors. So here I'll show all the qualitative colors and you can see that we have a whole bunch of colors.
1:12 So if you want to figure out what colors you want to use, you can use these swatches to kind of get a feel for what you like with
1:19 the pallets that are already there, I'll show how to use one. So let's look at our histogram and I'm going to say I want a color
1:28 discrete sequence of the qualitative set to which is right here and now we'll have a very different visualization with different colors.
1:39 So that can be helpful for you to figure out what colors make the most sense
1:43 for the visualizations you're creating. We can also generate sequential swatches.
1:49 There's a lot of these. This is really helpful when you're doing heat maps and
1:57 other types of visualization. So you can play around with this and decide what looks good for your specific use case.
2:07 So let's do another, histogram using our sequential colors. You can see that I've got these kind of green colors and what you might notice
2:17 that I put this underscore R on here. That means reverse the color. So if I take that out,
2:22 I get very light colors and dark and it's not really that easy to read. So, by putting the underscore R in here,
2:30 then I reversed the color palette so it's from low to high or high to low
2:33 Really helpful as you're playing around with your visualizations and figuring out the best way to present that to your customers.


Talk Python's Mastodon Michael Kennedy's Mastodon