Python interactive data visualization

Original article can be found here (source): Artificial Intelligence on Medium

Make it interactive

Lastly, make it interactive. Here is one possible implementation:

Plotly is an open source library with support for Python, R and Java programming languages. The plotly library comes with amazing modules for data visualization, manipulation and mapping. For this task, plotly.express module was used to display the scatter plot.

As shown above, Import the plotly library as well as the plotly.express module. Then, as was done with matplotlib earlier, plot the Longitude on the “x” axis and the Latitude on the “y” respectively. The parameter, “color”, regulates the color map and spectrum using a specified feature. Here, you need a feature that fully captures the full range of your target data distribution. The Hover_data parameter displays specified information to be displayed within the Hover_name heading. It represents the number of confirmed cases in a province_state along with the geographical coordinates(this could easily be any other feature, say…population). The “size” parameter however self explanatory.

interactive data visualization

There you go!👍 You can practice using different features that you are interested in to see how your map display changes.

Most importantly enjoy your interactive graphs and share your thoughts and knowledge with me and others!