I have a bokeh graph with a date on the x axis ( data["obs_date"]), and I want the other x axis at the top to cover the same range, but display in a different format ( mjdbelow).
I tried to add a second axis with:
plot.extra_x_ranges = {"MJD":
Range1d(start=Time(min(data["obs_date"])).mjd,
end=Time(max(data["obs_date"])).mjd)}
plot.add_layout(LinearAxis(x_range_name="MJD", axis_label="MJD",
axis_label_text_font_size="16pt"),
"above")
However, since bokeh adds a small buffer to the borders of the graph using min maxof data["obs_date"], since the restrictions for this new axis give me a slight offset - in the image below I 16 Jan 2018should align with 58134. It also makes it break when I have only one point to build.
How can I set the limits of my new axis so that it "knows" the limits of the primary axis? Starting to create a matplotlib background, I assume that the equivalent I'm looking for is this ax.get_xlim().

source
share