Questions tagged [bokeh]

Bokeh is a library for interactive visualization (including streaming or large datasets) that targets modern web browsers for presentation, and high level languages such as Python, Scala, and R for use.

Bokeh is an interactive visualization library for high level languages such Python, R and Scala, that natively targets modern web technologies. It is easily embeddable in common web-frameworks and can be used for standalone interactive documents, or server-backed data applications for large and streaming datasets.

4729 questions
31
votes
1 answer

Multiple questions with Object-Oriented Bokeh [OBSOLETE]

NOTE: This question concerns the "first generation" Bokeh server, which has been deprecated and removed for several years. Nothing in this question or its answers is relevant to any version of Bokeh >= 0.11 For detailed information about using…
szxk
  • 1,769
  • 18
  • 35
30
votes
1 answer

Plotting Pandas Multiindex Bar Chart

How can I plot a Python Pandas multiindex dataframe as a bar chart with group labels? Do any of the plotting libraries directly support this? This SO post shows a custom solution using matplotlib, but is there direct support for it? As an…
rbinnun
  • 1,169
  • 2
  • 10
  • 18
29
votes
4 answers

Exporting figures from Bokeh as svg or pdf?

Is it possible to output individual figures from Bokeh as pdf or svg images? I feel like I'm missing something obvious, but I've checked the online help pages and gone through the bokeh.objects api and haven't found anything...
groundlar
  • 878
  • 1
  • 8
  • 17
27
votes
4 answers

How to do waffle charts in python? (square piechart)

Something like this: There is a very good package to do it in R. In python, the best that I could figure out is this, using the squarify package (inspired by a post on how to do treemaps): import numpy as np import pandas as pd import matplotlib as…
lincolnfrias
  • 1,983
  • 4
  • 19
  • 29
26
votes
1 answer

What is the purpose of curdoc()?

I've been playing with bokeh for a little bit of time and I'm now at the step where I'd like to create interactive plots and embed them online (in WordPress posts, for example). However, even though I spent some time reviewing and testing code from…
etigrenier
  • 499
  • 1
  • 4
  • 14
26
votes
2 answers

Plotting multiple lines with Bokeh and pandas

I would like to give a pandas dataframe to Bokeh to plot a line chart with multiple lines. The x-axis should be the df.index and each df.columns should be a separate line. This is what I would like to do: import pandas as pd import numpy as np from…
bs123
  • 1,183
  • 3
  • 11
  • 21
25
votes
3 answers

How do I remove grid lines from a Bokeh plot?

I would like to remove the grid lines from a Bokeh plot. What is the best way to do this?
MRocklin
  • 55,641
  • 23
  • 163
  • 235
25
votes
2 answers

how to show integer, not float, with hover tooltip in bokeh

I have a simple graph of X-Y data points. I want my Bokeh figure to show me the integer value of each datapoint when I hover over it. I am close to getting what I want but when I hover over the data point, it shows a float and then higher up, it…
captain ahab
  • 1,029
  • 1
  • 11
  • 18
25
votes
2 answers

Position of the legend in a Bokeh plot

Does anyone know how to carry the legend in bokeh outside of the graph? The only manipulation I could do was to choose a position among: top_right, top_left, bottom_left or bottom_right using: legend()[0].orientation = "bottom_left" and when I try…
MajorYel
  • 379
  • 1
  • 5
  • 10
25
votes
4 answers

Disable scientific notation on axes using Bokeh

How can you disable scientific output of numbers on an axis in bokeh? For example, I want 400000 and not 4.00e+5 In mpl: ax.get_xaxis().get_major_formatter().set_scientific(False)
quasiben
  • 1,444
  • 1
  • 11
  • 19
24
votes
2 answers

With Bokeh, how to save to a png or jpg instead of a html file?

I need to export pictures of the graphs and plots I am creating with Bokeh. Usually I do output_file("test.html") However, I want to copy that graph into an Excel Sheet. It does not have to be interactive anymore, though that would be brillant. How…
user2366975
  • 4,350
  • 9
  • 47
  • 87
23
votes
3 answers

How to stop bokeh from opening a new tab in Jupyter Notebook?

First of all, before this is tagged as duplicate, I have read the other solutions and unfortunately none of them worked for me. My problem is that I want to display a bokeh plot in Juypter Notebook (and only in Jupyter Notebook), not in a new …
pfincent
  • 452
  • 2
  • 7
  • 21
22
votes
7 answers

Bokeh: Models must be owned by only a single document

I'm working with Bokeh 0.12.2 in a Jupyter notebook and it frequently throws exceptions about "Models must be owned by only a single document": --------------------------------------------------------------------------- RuntimeError …
patricktokeeffe
  • 1,058
  • 1
  • 11
  • 21
22
votes
2 answers

Adjust title font size for a Bokeh figure

How do I set the title font size for a figure when using bokeh? I tried (in ipython notebook): import bokeh.plotting as bp import numpy as np bp.output_notebook() x_points = np.random.rand(100) y_points = np.random.rand(100) bp.figure(title='My…
dmb
  • 1,669
  • 1
  • 12
  • 21
21
votes
1 answer

Bokeh server callback initiated from Flask application

I am building an app using the Flask-AppBuilder framework, and have successfully embedded a bokeh plot using autoload_server to insert the script src into my html template. At the moment, I have a widget button inside the bokeh app which triggers a…
GratefulGuest
  • 777
  • 7
  • 15