Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created March 17, 2018 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WillKoehrsen/b01418736856841785ac2b2cfb061f90 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/b01418736856841785ac2b2cfb061f90 to your computer and use it in GitHub Desktop.
# Create the blank plot
p = figure(plot_height = 600, plot_width = 600,
title = 'Histogram of Arrival Delays',
x_axis_label = 'Delay (min)]',
y_axis_label = 'Number of Flights')
# Add a quad glyph with source this time
p.quad(bottom=0, top='flights', left='left', right='right', source=src,
fill_color='red', line_color='black', fill_alpha = 0.75,
hover_fill_alpha = 1.0, hover_fill_color = 'navy')
# Add a hover tool referring to the formatted columns
hover = HoverTool(tooltips = [('Delay', '@f_interval'),
('Num of Flights', '@f_flights')])
# Style the plot
p = style(p)
# Add the hover tool to the graph
p.add_tools(hover)
# Show the plot
show(p)
@briandtroup
Copy link

need to change '@f_flights' to '@flights' in the definition of hover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment