I tried creating a figure with 2 different x-axis. It works as long as I set both x_axis_location= “below” OR one x_axis_location set to ‘below’ and one to ‘above’. However , I cannot set both to ‘above’ the plot does not render correctly. Any ideas?
import numpy as np
from bokeh.plotting import figure, show, output_file, hplot
from bokeh.models import LinearAxis, Range1d
N = 100
y = np.linspace(1,101,N)
x =10-np.log(y)
s = np.linspace(30, 35, N)
s[0:10]=np.linspace(10, 30, 10)
yr = Range1d(start=101,end=0)
output_file(“XISSUES.html”)
TOOLS = “pan,wheel_zoom,box_zoom,reset,save,box_select”
p3 = figure(title=“X ABOVE”,y_range=yr, x_range=(0, 10),x_axis_location=“above”, tools=TOOLS)
p3.circle(x, y, legend="Fake Temperature ")
p3.xaxis.axis_line_color =“blue”
p3.xaxis.major_label_text_color = “blue”
p3.extra_x_ranges = {“foo”: Range1d(start=0, end=35)}
p3.circle(s, y, fill_color=“green”, size=5, line_color=“green”, x_range_name=“foo”, legend=“fake Salinity”)
p3.add_layout(LinearAxis(x_range_name=“foo”, axis_line_color=“green”,major_label_text_color=“green”), “above”)
show(p3)