![]() ![]() Sine = figure(width=500, plot_height=500, title='Sine') Note that you will need NumPy installed for the following example to work correctly: I reduced the example down a bit to just one sine wave. The Bokeh quick start guide has a neat example of a series of sine waves on a grid plot. You should end up seeing something like this:īokeh also supports the Jupyter Notebook with the only change being that you will need to use output_notebook instead of output_file. The show command will actually open your plot in your default browser. Finally we plot the line, give it a legend and line width and show the plot. Then we actually create the figure object and give it a title and labels for the two axises. Then we create some values for the x and y axises so we can create the plot. We just tell it where to save the output. Here we just import a few items from the Bokeh library. Plot.line(x, y, legend='Test', line_width=4) Plot = figure(title='Line example', x_axis_label='x', y_axis_label='y') Save the following code into a file with whatever name you deem appropriate.įrom otting import figure, output_file, show You may want to install Bokeh into a virtualenv because of this, but that’s up to you. ![]() This will install Bokeh and all its dependencies. The easiest way to do so is to use pip or conda. Let’s take a moment and get it installed. Instead, the aim of the article is to give you a taste of what this interesting library can do. Note: This will not be an in-depth tutorial on the Bokeh library as the number of different graphs and visualizations it is capable of is quite large. One of its primary competitors seems to be Plotly. You will probably be using this library for creating plots / graphs. Bokeh supports large and streaming datasets. Its goal is to provide graphics in the vein of D3.js that look elegant and are easy to construct. The Bokeh package is an interactive visualization library that uses web browsers for its presentation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |