Am a complete noob in bokeh. Doing this for the first time. I copied a sample plot from Python Bokeh tutorial - Interactive Data Visualization with Bokeh - GeeksforGeeks
To run the code, this is what I did:
- installed latest bokeh version (it was a new install). Installation was with pip
- ran in python 3.10 version
- pasted below code for plotting into a temp.py file:
from bokeh.plotting import figure, output_file, show
graph = figure( title = "Bokeh Line Graph" )
x = [1, 2, 3, 4, 5]
y = [5, 4, 3, 2, 1]
graph.line( x, x, legend_label = "Line 1" )
graph.line( y, x, legend_label = "Line 2",
line_color = "green" )
show( graph )
- ran it.
- File is getting generated. Am opening it via MS Edge (retried with chrome as well)
- File is opening; Only issue is that its an empty page.
- I checked the file in explorer (copied file location from edge/chrome’s address bar)
- File does exist, and is of non-zero size
What am I doing wrong?
I rechecked the entries in community page - there’s no mention of this issue anywhere (except one from 2015), so I’m guessing I am doing something wrong … I just cant figure out what the error is. Any help will be appreciated.
I tired attaching the html file here, but the website isnt allowing it…
Hi @arun please edit your post to use code formatting so that the code is intelligible (either with the
</> icon on the editing toolbar, or triple backtick ``` fences around the code blocks). I had to manually edit all “fancy quotes” to be plain ascii quotes in order to run your code.
Your code produces the expected output for me on OSX/Chrome:
Does your output work on other browers besides Edge? What version of Edge (old non-Chromium Edge, or recent Chromium-based Edge?)
I have bumped you up from New User, you should be able to attach your file now. Or if not, you can put it in a gist: https://gist.github.com/ so that we can look at it.
Thanks for the reply.
Really sorry for the hiccup - I didnt realize we have this kind of segregation.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.