![]() While I can’t share the code behind this project, I can walk through an example of building a fully-interactive Bokeh application using publicly available data. ![]() ![]() An example of the interactive capabilities of Bokeh are shown in this dashboard I built for my research project: Recently, inspired by the trend towards interactive plots and a desire to keep learning new tools, I have been working with Bokeh, a Python library. With regards to my research, a report telling a building owner how much electricity they can save by changing their AC schedule is nice, but it’s more effective to give them an interactive graph where they can choose different schedules and see how their choice affects electricity consumption. People like to see data in static graphs but what they enjoy even more is playing with the data to see how changing parameters affects the results. With all these advances there is one common trend: increased interactivity. The resources available for data science are advancing rapidly which is especially pronounced in the realm of visualization where it seems there is another option to try every week. My conclusion was we can do the most rigorous analysis, but at the end of the day, all people want to see is a gif! While this statement is meant to be humorous, it has an element of truth: results will have little impact if they cannot be clearly communicated, and often the best way for presenting the results of an analysis is with visualizations. Now, instead of struggling to explain wavelets, my team member can show the clip to provide an intuitive idea of how the technique works. In a couple minutes using an R package called gganimate, I made a simple animation showing how the method transforms a time-series. The method achieves positive results, but she was having trouble explaining it without getting lost in the technical details.Įxasperated, she asked me if I could make a visual showing the transformation. For the past several months, one of my team members has been working on a technique called wavelet transforms which is used to analyze the frequency components of a time-series. This point was driven home by a recent experience I had on my research project, where we use data science to improve building energy efficiency. The most sophisticated statistical analysis can be meaningless without an effective means for communicating the results. P.Data Visualization with Bokeh in Python, Part I: Getting Started # Add a line renderer with legend and line thickness P = figure(title="Simple Line Plot in Bokeh", x_axis_label='x', y_axis_label='y') # Create a new plot with a title and axis labels # Make Bokeh Push push output to Jupyter Notebook.įrom bokeh.io import push_notebook, show, output_notebook Here is a simple example of how to use Bokeh in Jupyter Notebook: import numpy as np If you already have a version of Python then you can run the following in cmd.exe on Windows or terminal on Mac: pip install bokehīe sure to check out the Bokeh quick start guide for several examples. Once you have anaconda installed onto your machine then you can simply run the following in cmd.exe on Windows or terminal on Mac: conda install bokeh Which you can download and install for free. Īll of those come with the Anaconda Python Distribution. If you plan on installing with Python 2.7 you will also need future. NumPy, Jinja2, Six, Requests, Tornado >= 4.0, PyYaml, DateUtil Installing Bokeh Bokeh's Docs on Installationīokeh runs on Python it has the following dependencies The -show parameter tells bokeh to open a browser window and show document defined in hello_world.py. To launch it you need to execute bokeh on the command line and use the serve command to launch the server: $ bokeh serve -show hello_world.py Plot.line('x', 'y', source=data_source, line_width=3, line_alpha=0.6) Tools="crosshair,pan,reset,save,wheel_zoom",) ![]() """Add a plotted function to the document.ĭoc: A bokeh document to which elements can be added.ĭata_source = ColumnDataSource(data=dict(x=x_values, y=y_values)) We will use this example script ( hello_world.py ): from bokeh.models import ColumnDataSource To use bokeh you need to launch a bokeh server and connect to it using a browser. Its goal is to provide elegant, concise construction of novel graphics in the style of D3.js, and to extend this capability with high-performance interactivity over very large or streaming datasets.īokeh can help anyone who would like to quickly and easily create interactive plots, dashboards, and data applications. Bokeh is a Python interactive visualization library that targets modern web browsers for presentation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |