code: import pandas as pd
  
  from bokeh.charts import Line, Scatter, show, output_file, defaults
  from bokeh.layouts import gridplot
  from bokeh.models import HoverTool
  from bokeh.sampledata.degrees import data
  
  defaults.width = 500
  defaults.height = 300
  
  TOOLS='box_zoom,box_select,hover,crosshair,reset'
  
  TOOLTIPS = [ ("y", "$~y"), ("x", "$~x") ]
  
  data = data[['Biology', 'Business', 'Computer Science', "Year"]]
  data = pd.melt(data, id_vars=['Year'],
                 value_vars=['Biology', 'Business', 'Computer Science'],
                 value_name='Count', var_name='Degree')
  
  vline = Line(data, y='Count', color='Degree', title="Lines VLine", ylabel='measures',
               tools=TOOLS)
  
  hline = Line(data, y='Count', color='Degree', title="Lines HLine",
               ylabel='measures', tools=TOOLS)
  
  int_vline = Line(data, y='Count', color='Degree', title="Lines VLine Interp",
                   ylabel='measures', tools=TOOLS)
  
  int_hline = Line(data, y='Count', color='Degree', title="Lines HLine Interp",
                   ylabel='measures', tools=TOOLS)
  
  scatter_point = Scatter(data, x='Year', y='Count', color='Degree',
                          title="Scatter mouse", ylabel='measures', legend=True,
                          tools=TOOLS)
  
  scatter = Scatter(data, x='Year', y='Count', color='Degree',
                    title="Scatter V Line", ylabel='measures', legend=True, tools=TOOLS)
  
  int_point_line = Line(data, x='Year', y='Count', color='Degree',
                        title="Lines Mouse Interp.", ylabel='measures', tools=TOOLS)
  
  point_line = Line(data, x='Year', y='Count', color='Degree',
                    title="Lines Mouse", ylabel='measures', tools=TOOLS)
  
  
  hhover = hline.select(HoverTool)
  hhover.mode = 'hline'
  hhover.line_policy = 'next'
  
  vhover = vline.select(HoverTool)
  vhover.mode = 'vline'
  vhover.line_policy = 'nearest'
  
  int_hhover = int_hline.select(HoverTool)
  int_hhover.mode = 'hline'
  int_hhover.line_policy = 'interp'
  
  int_vhover = int_vline.select(HoverTool)
  int_vhover.mode = 'vline'
  int_vhover.line_policy = 'interp'
  
  iphover = int_point_line.select(HoverTool)
  iphover.mode = 'mouse'
  iphover.line_policy = 'interp'
  
  tphover = point_line.select(HoverTool)
  tphover.mode = 'mouse'
  
  shover = scatter.select(HoverTool)
  shover.mode = 'vline'
  
  shoverp = scatter_point.select(HoverTool)
  shoverp.mode = 'mouse'
  
  # set up tooltips
  int_vhover.tooltips = int_hhover.tooltips = TOOLTIPS
  tphover.tooltips = iphover.tooltips = TOOLTIPS
  shover.tooltips = shoverp.tooltips = TOOLTIPS
  vhover.tooltips = hhover.tooltips = TOOLTIPS
  
  output_file("hover_span.html", title="hover_span.py example")
  
  show(gridplot(hline, vline, int_hline, int_vline,
                int_point_line, point_line, scatter_point, scatter,
                ncols=2))
   import numpy as np
  
  from bokeh.util.browser import view
  from bokeh.document import Document
  from bokeh.embed import file_html
  from bokeh.models.glyphs import ImageURL
  from bokeh.models import ColumnDataSource, Range1d, Plot, LinearAxis, Grid
  from bokeh.resources import INLINE
  
  url = "http://bokeh.pydata.org/en/latest/_static/images/logo.png"
  N = 5
  
  source = ColumnDataSource(dict(
      url = [url]*N,
      x1  = np.linspace(  0, 150, N),
      y1  = np.linspace(  0, 150, N),
      w1  = np.linspace( 10,  50, N),
      h1  = np.linspace( 10,  50, N),
      x2  = np.linspace(-50, 150, N),
      y2  = np.linspace(  0, 200, N),
  ))
  
  xdr = Range1d(start=-100, end=200)
  ydr = Range1d(start=-100, end=200)
  
  plot = Plot(x_range=xdr, y_range=ydr)
  plot.title.text = "ImageURL"
  plot.toolbar_location = None
  
  image1 = ImageURL(url="url", x="x1", y="y1", w="w1", h="h1", anchor="center", global_alpha=0.2)
  plot.add_glyph(source, image1)
  
  image2 = ImageURL(url="url", x="x2", y="y2", w=20, h=20, anchor="top_left")
  plot.add_glyph(source, image2)
  
  image3 = ImageURL(url=dict(value=url), x=200, y=-100, anchor="bottom_right")
  plot.add_glyph(source, image3)
  
  xaxis = LinearAxis()
  plot.add_layout(xaxis, 'below')
  
  yaxis = LinearAxis()
  plot.add_layout(yaxis,'left')
  
  plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
  plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))
  
  doc = Document( )
  doc.add_root(plot)
  
  if __name__ == "__main__":
      doc.validate()
      filename = "image_url.html"
      with open(filename, "w") as f:
          f.write(file_html(doc, INLINE, "Image URL Example"))
      print("Wrote %s" % filename)
      view(filename)
  
apis: pandas.melt
apis: numpy.linspace