bokeh

Bokeh figure doesn't show

梦想的初衷 提交于 2019-12-12 04:32:55
问题 I am new to python. I tried the example given in here http://docs.bokeh.org/en/latest/docs/gallery/color_scatter.html with my own dataset, which looks like this Unnamed: 0 fans id stars 0 0 69 18kPq7GPye-YQ3LyKyAZPw 4.14 1 1 1345 rpOyqD_893cqmDAtJLbdog 3.67 2 2 105 4U9kSBLuBDU391x6bxU-YA 3.68 3 3 2 fHtTaujcyKvXglE33Z5yIw 4.64 4 4 5 SIBCL7HBkrP4llolm4SC2A 3.80 here's my code: import pandas as pd from bokeh.plotting import figure, show, output_file op = pd.read_csv('FansStars.csv') x = op.stars

Pandas, Bokeh, or using any plotting library for shifting the x-axis for seasonal data (months 7 -> 12 -> 6 or July 01 - June 30)

柔情痞子 提交于 2019-12-12 03:57:02
问题 I want to display seasonal snow data for the seasonal year from July 01 - June 30. df = pd.DataFrame({'date1':['1954-03-20','1955-02-23','1956-01-01','1956-11-21','1958-01-07'], 'date2':['1954-03-25','1955-02-26','1956-02-11','1956-11-30','1958-01-17']}, index=['1954','1955','1956','1957','1958']) It is an extension to my previous question Pandas: Visualizing Changes in Event Dates for Multiple Years using Bokeh or any other plotting library Scott Boston, in his answer to my comment in that

Python Bokeh - Assign taptool to a subset of Glyphs

只谈情不闲聊 提交于 2019-12-12 03:45:41
问题 Hi have a timeserie to which I add circle glyphs, representing 2 different type of data. I already managed to assign a different tooltip to each of them by using the suggestion presented here: https://stackoverflow.com/a/37558475/4961888 I was hoping I could use a similar syntax to assign a specific subset of the glyph to a taptool, that would bring me to a url present in the source of those glyphs. so I tried: fig = figure(x_axis_type="datetime", height=200, tools="tap") fig.line(x_range, y

Bokeh time series plot annotation is off by 1 hour

梦想的初衷 提交于 2019-12-12 03:09:09
问题 I am plotting a Bokeh plot with a datetime X-axis. When adding an annotation to the plot I notice that the time is one hour off. I suspect this is due to me being in an UTC+1 time-zone, although it could also be some +1 indexing difference somewhere. The code to reproduce: xrange = pandas.date_range('1/1/2011', periods=12, freq='H') event = pandas.Timestamp('1/1/2011 05:00:00') data = pandas.Series([1]*12, index=xrange) data[event] = 3 plot = bokeh.plotting.figure(x_axis_type="datetime") plot

Bokeh plot does not appear on the same django page after csv upload

徘徊边缘 提交于 2019-12-12 02:42:17
问题 Related: Embedding Bokeh plot in Django website results in blank page with no error message Except this time I'm using the correct version. I have code where all I want to see is a website with an upload button where after a csv is uploaded, a bokeh plot appears on the same page. Uploading of the csv works. With the debugger I can see I have lists x_of_pixels and y_of_pixels and now I should simply be able to generate a Bokeh plot of the one against the other. However, after upload, no error

Bokeh plot tag rendering issue

这一生的挚爱 提交于 2019-12-12 01:43:32
问题 I am using the embed .html example given on the bokeh site: http://docs.bokeh.org/en/latest/docs/user_guide/embed.html. Note I am using bokeh 12.3. The plots are displaying fine but the text is rendering as the exact output from the script function - including '{' and '\n' characters. scatter function: from bokeh.plotting import figure from bokeh.models import Range1d from bokeh.embed import components def scatter(): # create some data x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y1 = [0, 8, 2, 4,

Updating color mapper in a bokeh plot with taptool

天涯浪子 提交于 2019-12-12 01:39:45
问题 I need to change the color map of polygons based on a variable that the user can select. I can update the colors, but if I select one polygon with TapTool then the initial color map appears: from bokeh.plotting import figure, curdoc from bokeh.layouts import column, layout from bokeh.models import ColumnDataSource, LinearColorMapper, ColorBar, BasicTicker, Select from bokeh.palettes import Viridis256 as palette palette.reverse() TOOLS = "tap" p = figure(title="Coloring Humidity", tools=TOOLS)

Python Bokeh Hover Tool giving: AttributeError: unexpected attribute 'tooltips' to Figure

那年仲夏 提交于 2019-12-12 00:51:55
问题 How do I implement "tooltips" for the hover tool in Bokeh 0.12.11 (and possibly other versions)? Searching for "Bokeh hover tooltips" gives a bunch of documentation results such as: https://docs.bokeh.org/en/latest/docs/user_guide/tools.html But when I try to implement the "tooltips" on Bokeh 0.12.11 from an example such as: https://docs.bokeh.org/en/latest/docs/gallery/elements.html I get the following error: AttributeError: unexpected attribute 'tooltips' to Figure, possible attributes are

Bokeh callback for image update

情到浓时终转凉″ 提交于 2019-12-11 23:47:16
问题 I have a Bokeh plot that can display an image, which can be changed by a slider (and also should update regularly) (similar to this question Sliding through images with Bokeh Slider). So the url of the image changes and Bokeh reloads the image. Is there a way to attach a callback function to the load of the image? 回答1: As of Bokeh 1.4.0 there is no callback on the image load. The ImageURL glyph is not one that is much used by the core developers, AFAIK, and we can't always anticipate every

ImportError when trying to embed a Bokeh plot alongside a Django upload button

六眼飞鱼酱① 提交于 2019-12-11 23:19:31
问题 I'm trying to embed a Bokeh plot into a Django site that has an upload button. I'm using the example given here as a starting point and then adding on the instructions on embedding from here. I used need-a-minimal-django-file-upload-example/for_django_1.8 and it works as intended. I've then modified the following files, but I get the following error: ImportError: No module named 'myapp' You can see my directory structure here and the three files modified/added: If you cannot load the image,