def transform_xy_coords(xy_coords, sc_plot):
 sorted_keys = xy_coords.keys()
 all_cids = []
 all_xcoords = []
 all_ycoords = []
 sc_plot.set_transform(sc_plot.axes.transData)
 trans = sc_plot.get_transform()
 for s_label in sorted_keys:
  s_data = xy_coords[s_label]
  if (s_data[0] == []):
   pass
  else:
   icoords = trans.transform(zip(s_data[0], s_data[1]))
   (xcoords, ycoords) = zip(*icoords)
   all_cids.extend(s_data[2])
   all_xcoords.extend(xcoords)
   all_ycoords.extend(ycoords)
 return (all_cids, all_xcoords, all_ycoords)

def transform_xy_coords ( xy_coords , sc_plot ) : sorted_keys = xy_coords . keys ( ) all_cids = [ ] all_xcoords = [ ] all_ycoords = [ ] sc_plot . set_transform ( sc_plot . axes . transData ) trans = sc_plot . get_transform ( ) for s_label in sorted_keys : s_data = xy_coords [ s_label ] if ( s_data [ 0 ] == [ ] ) : pass else : icoords = trans . transform ( zip ( s_data [ 0 ] , s_data [ 1 ] ) ) ( xcoords , ycoords ) = zip ( * icoords ) all_cids . extend ( s_data [ 2 ] ) all_xcoords . extend ( xcoords ) all_ycoords . extend ( ycoords ) return ( all_cids , all_xcoords , all_ycoords )
transform the coords from the scatterplot into coords that can be referenced in the html page .