Python Data Visualization Transcripts
Chapter: Plotly
Lecture: API overview
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Now that we've gone through some examples. I want to walk through the overall structure. I use for customizing my plots using the plotly. express API
0:09
One of the things I like about plotly is that simple and there's kind of a consistent process for updating all the images. So here's the process I use.
0:18
First you import plotly express as PX. Then you create your figure of a plot type. You pass on your data frame,
0:26
the columns. And then you can also facet the rows and columns which will walk through in a little bit. But here are some of the common plot types.
0:33
So if you want to do a scatter or align bar chart, just put those plot types in there, fill in your columns. You can also do a lot of more complex
0:42
Plot types such as tree maps, sunburst, funnel plot. And then you can customize your plot with the arguments to
0:49
that plot type, so we can change the color, the title. We talked about templates,
0:54
there's also hovering in the way we control our categories all available through the arguments to that specific plot type. And then finally,
1:02
once you're done with the basic plot type, you can customize it using a couple different types of customization. You can update the layout in their X.
1:10
And Y axis or you can add vertical lines and rectangles. And this combination allows you to create a bunch of different plots and then customize them
1:22
for your own needs and I find that this is intuitive and makes a lot of
1:26
sense and that's one of the reasons why I really like using plotly we express for my data visualizations.