From the course: Python Data Visualization: Create Impactful Visuals, Animations, and Dashboards by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Demo

Demo

Finally, we reach the final demo of our long exploration of data visualization in Python. In this demo, we're going to look at Plotly, which in my opinion is one of the most flexible and powerful visualization packages in Python because it combines the advantages of several different other packages as we will see. We start by importing all the packages and modules we're going to be using. You can see now that Plotly is already much more well-organized than Bokeh. You don't need 30 different imports, just need three or four. I'm using Plotly version 5.9.0. Just to get started, all we have to do is essentially call px.line. This is coming from Plotly Express. This will simply plot a line connecting these sets of points. As the case of Bokeh, nothing gets displayed until we call the show method on the figure object and so we get our nice line. We automatically get the hover tool tips with the coordinates of the data point as the mouse hovers over them. Of course, we get the toolbar on…

Contents