# set up where to send people when they click on a planet url = "@url" taptool = fig.select(TapTool) taptool.callback = OpenURL(url=url) # figure out what the default axis limits are ydiff = np.log10(ymax) - np.log10(ymin) ystart = 10.**(np.log10(ymin) - 0.05 * ydiff) yend = 10.**(np.log10(ymax) + 0.05 * ydiff) # jupiter/earth mass ratio massratio = 317.8 # add the first y-axis's label and use our custom log formatting for both axes fig.yaxis.axis_label = 'TSM' fig.yaxis.formatter = FuncTickFormatter(code=log_axis_labels()) # add the x-axis's label and use our custom log formatting fig.xaxis.axis_label = 'Radius (Earth Radii)' fig.xaxis.formatter = FuncTickFormatter(code=log_axis_labels()) # set up all the legend objects items = [ LegendItem(label=ii + f' ({counts[methods.index(ii)]})', renderers=[jj]) for ii, jj in zip(methods, glyphs) ] # create the legend legend = Legend(items=items, location="center") legend.title = 'Discovered via' legend.spacing = 10 legend.margin = 8
line_width=5, line_color='black', name='Predicted', legend_label=f'Doubling Time: {tdouble:.2f} years') fig2.vbar_stack(methods, x='years', width=0.9, color=colors, source=cumul, legend_label=leglab, line_width=0) # add the first y-axis's label and use our custom log formatting # for both axes fig2.yaxis.axis_label = 'Number' fig2.yaxis.formatter = FuncTickFormatter(code=log_axis_labels( max_tick=5.1)) # add the x-axis's label and use our custom log formatting if xx < 2: fig2.xaxis.axis_label = 'Year of Confirmation' else: fig2.xaxis.axis_label = 'Year of Discovery' # create the legend legend = fig2.legend legend.location = 'top_left' # legend.orientation = "vertical" legend.title = 'Discovered via' # legend.spacing = 10 # legend.margin = 8