JuliaPy / JuliaPy/PyCall.jl

Error: Not showing python's bokeh plot on jupyter notebook when using PyCall.jl + py""" ~ """

Aperta
#1,030 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
1.5k
Fork
186
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I want to include interactive log plot with python's bokeh package and PyCall.jl
(https://docs.bokeh.org/en/latest/docs/examples/basic/axes/logplot.html)

However, outputing the interactive plot in jupyter notebook doesn't work when using PyCall.jl + py"""~"""
Here is my code.

Any ideas?

```julia
using PyCall

py"""
import numpy as np
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
output_notebook() # outputing visualization in jupyter notebook!!

x = np.linspace(0.1, 5, 80)
p = figure(title="log axis example", y_axis_type="log",
x_range=(0, 5), y_range=(0.001, 10.0**22),
background_fill_color="#fafafa")

p.line(x, np.sqrt(x), legend_label="y=sqrt(x)",
line_color="tomato", line_dash="dashed")

p.line(x, x, legend_label="y=x")
p.scatter(x, x, legend_label="y=x")

p.line(x, x**2, legend_label="y=x**2")
p.scatter(x, x**2, legend_label="y=x**2",
fill_color=None, line_color="olivedrab")

p.line(x, 10**x, legend_label="y=10^x",
line_color="gold", line_width=2)

p.line(x, x**x, legend_label="y=x^x",
line_dash="dotted", line_color="indigo", line_width=2)

p.line(x, 10**(x**2), legend_label="y=10^(x^2)",
line_color="coral", line_dash="dotdash", line_width=2)

p.legend.location = "top_left"

show(p)

"""

```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by running the provided Julia reproducer in a Jupyter notebook with PyCall.jl, focusing on the Python bokeh output_notebook() and show(p) calls. Compare the result with the linked Bokeh log-plot example; the issue is resolved when the interactive plot renders in the notebook.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook, python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.