Access plot axis from JS

In Python we can do something like that

p = figure(..)
p.axis
p.xaxis

But it seems like that axis or xaxis is not available inside a custom JS script. Am I missing something? How can one update the label font size with a JS callback?

You re not missing anything. The Python and JavaScript sides are similar, but they are not identical. In some cases they simply cannot be identical, due to language difference. On the JS side, you will need to search through plot.renderers to find the Axis model you want. Or, if you configure a name on the axis in Python, you can use plot.select_one("some_name") on the JS side to query for it.

2 Likes