12/1/2023 0 Comments Bokeh interactive plots![]() Pygal and bqplot did not fair as well (though I suppose they were not designed to do exactly what I had in mind). ![]() mpld3, matplotlib + ipywidgets and Streamlit fulfilled most of my criteria. The table below summarizes my ability to achieve the goals I listed above with each of the tools.īokeh, Plotly and Altair all were able to fulfill each of my criteria. Format the “tooltips” to show information when you hover over the data in the plot.When the value of either of these changes, the tool uses a “callback” function to change the data shown in the plot. Create the initial figure using one country (e.g., USA) and one particular column of data (e.g., Daily Cases).In general, each plotting tool requires some version of the following workflow: I will also include some interactive figures below for you to test out within this blog post. If you download and run the notebook on your computer, you can generate the interactive figures for your own exploration. I encourage you to look at that notebook to see the different syntax and code length required to create figures with each tool. You can view the code that I wrote to create the figures for each of the tools on my GitHub repo in this Jupyter notebook. html file for use on a personal website (without needing any other service).Īfter scouring the internet for the most popular Python interactive plotting packages, I decided to test this set of tools: create a set of buttons to choose which columns I want to plot (for a given country), and.create a dropdown menu to choose the country,.create customizable tooltips to show the data values when the mouse hovers over the plot,.time (while displaying the date correctly) My goal was to create the same interactive plot using a variety of different plotting packages in Python, that ideally allow me to: (Yes, I know we’ve all had enough of COVID-19, but it’s a great dataset!) This dataset contains COVID-19 cases and deaths over time for 237 countries. I decided to look at COVID-19 data from the World Health Organization (WHO). I’ll endeavor to answer the question posted in the blog title at the end of this post, so please read on. I recently went on a deep dive into the interactive plotting ecosystem of Python, and in this blog post I’m going to share my personal opinions on what works and what doesn’t within the most popular Python interactive packages available now. They can be incredibly useful tools for investigating your data and for sharing your data and research results with others. I love using, creating and teaching people about interactive figures.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |