# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

# +
# A Basic bokeh line graph

from bokeh.plotting import figure
from bokeh.io import output_file, show

x = [1, 2, 3, 4, 5]
y = [6, 7, 8, 9, 10]

output_file('Line.html')

fig = figure()
fig.line(x, y)

show(fig)

# +
# Bokeh with Pandas

from bokeh.plotting import figure
from bokeh.io import output_file, show
import pandas

data_frame = pandas.read_csv('data.csv')

x = data_frame['x']
y = data_frame['y']

output_file('Line.html')

fig = figure()
fig.line(x, y)

show(fig)

# +
# Bokeh with Pandas - Bachelors_csv

from bokeh.plotting import figure
from bokeh.io import output_file, show
import pandas

data_frame = pandas.read_csv('http://pythonhow.com/data/bachelors.csv')

x = data_frame['Year']
y = data_frame['Engineering']

output_file('Line.html')

fig = figure()
fig.line(x, y)

show(fig)

# +
import pandas
from bokeh.plotting import figure, output_file, show
 
p=figure(plot_width=500,plot_height=400, tools='pan')
 
p.title.text="Cool Data"
p.title.text_color="Gray"
p.title.text_font="times"
p.title.text_font_style="bold"
p.xaxis.minor_tick_line_color=None
p.yaxis.minor_tick_line_color=None
p.xaxis.axis_label="Date"
p.yaxis.axis_label="Intensity"    
 
p.line([1,2,3],[4,5,6])
output_file("graph.html")
show(p)

# +
import pandas
 
from bokeh.plotting import figure, output_file, show
 
df=pandas.read_excel("http://pythonhow.com/data/verlegenhuken.xlsx",sheet_name=0)
df["Temperature"]=df["Temperature"]/10
df["Pressure"]=df["Pressure"]/10
 
p=figure(plot_width=500,plot_height=400,tools='pan')
 
p.title.text="Temperature and Air Pressure"
p.title.text_color="Gray"
p.title.text_font="arial"
p.title.text_font_style="bold"
p.xaxis.minor_tick_line_color=None
p.yaxis.minor_tick_line_color=None
p.xaxis.axis_label="Temperature (°C)"
p.yaxis.axis_label="Pressure (hPa)"    
 
p.circle(df["Temperature"],df["Pressure"],size=0.5)
output_file("Weather.html")
show(p)
# -

from bokeh.plotting import figure, output_file, show
p = figure(plot_width=500, plot_height=400, tools = 'pan, reset')
p.title.text = "Earthquakes"
p.title.text_color = "Orange"
p.title.text_font = "times"
p.title.text_font_style = "italic"
p.yaxis.minor_tick_line_color = "Yellow"
p.xaxis.axis_label = "Times"
p.yaxis.axis_label = "Value"
p.circle([1,2,3,4,5], [5,6,5,5,3], size = [i*2 for i in [8,12,14,15,20]], color="red", alpha=0.5)
output_file("Scatter_plotting.html")
show(p)

# +
from bokeh.plotting import figure, output_file, show
import pandas


data_frame = pandas.read_csv(
    'adbe.csv',
    parse_dates=['Date']
)

fig = figure(width=800, height=250, x_axis_type='datetime')
fig.line(data_frame['Date'], data_frame['Close'], color='Orange', alpha=0.5)

output_file('Timeseries.html')
show(fig)

StarcoderdataJupyterScriptsDedupFiltered