wilmerags commited on
Commit
2c7ffd9
·
1 Parent(s): 1c4df76

test: Trying to place legend outside or better

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -105,16 +105,19 @@ def draw_interactive_scatter_plot(
105
  Palette = AuxPallete
106
  p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
107
  colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
 
 
 
 
 
 
108
  p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="original_label")
109
  p.axis.visible = False
110
  p.xgrid.grid_line_dash = "dashed"
111
  p.ygrid.grid_line_dash = "dashed"
112
  # p.xgrid.grid_line_color = None
113
  # p.ygrid.grid_line_color = None
114
- # p.toolbar.logo = None
115
- p.legend.location = "bottom_right"
116
- p.legend.title = "Topics ID"
117
- p.legend.background_fill_alpha = 0.2
118
 
119
  disclaimer = Label(x=0, y=0, x_units="screen", y_units="screen",
120
  text_font_size="14px", text_color="gray",
 
105
  Palette = AuxPallete
106
  p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
107
  colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
108
+
109
+ p.legend.location = "right"
110
+ p.legend.title = "Topics ID"
111
+ p.legend.click_policy = "mute"
112
+ p.legend.background_fill_alpha = 0.2
113
+
114
  p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="original_label")
115
  p.axis.visible = False
116
  p.xgrid.grid_line_dash = "dashed"
117
  p.ygrid.grid_line_dash = "dashed"
118
  # p.xgrid.grid_line_color = None
119
  # p.ygrid.grid_line_color = None
120
+ p.toolbar.logo = None
 
 
 
121
 
122
  disclaimer = Label(x=0, y=0, x_units="screen", y_units="screen",
123
  text_font_size="14px", text_color="gray",