SHARE
TWEET

Untitled

a guest Jun 16th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mapper = LinearColorMapper(palette=Magma256, high=df_complete.score.max(), low=df_complete.score.min())
  2.  
  3. TOOLS = "hover, save, pan, box_zoom, undo, redo, reset, wheel_zoom"
  4.  
  5. p = figure(title="Heatmap of Sites", x_range=Position, y_range=Values,
  6.            x_axis_location="above", plot_width=900, plot_height=400,
  7.            tools=TOOLS, toolbar_location='below',
  8.            tooltips=[('Position','@Position'),('Score', '@score'), ('Sequence', '@Sequence')])
  9.  
  10. p.grid.grid_line_color = None
  11. p.axis.axis_line_color = None
  12. p.axis.major_tick_line_color = None
  13. p.axis.major_label_text_font_size = "8pt"
  14. p.axis.major_label_standoff = 0
  15. p.xaxis.major_label_orientation = pi / 3
  16. p.xaxis.ticker = ContinuousTicker(desired_num_ticks = 50) ###
  17.  
  18. p.rect(x="Position", y="Values", width=1, height=1,
  19.        source=df_complete,
  20.        fill_color={'field':'score', 'transform' : mapper},
  21.        line_color=None)
  22.  
  23. color_bar = ColorBar(color_mapper=mapper, major_label_text_font_size="8pt",
  24.                      ticker=BasicTicker(),
  25.                      label_standoff=6, border_line_color=None, location=(0, 0))
  26.  
  27. p.add_layout(color_bar, 'right')
  28. show(p)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top