Thanks!!! I didn’t know “scene”. Does that mean that you can also plot arbitrary polygons and lines on the scene using the scene coordinates? (← I wrote this before I search the Internet. Where do you find a documentation or tutorial about plotting on the scene?)
The remaining problem I wan to solve is to find the relationship between the user coordinates within the “axes” to the “scene” coordinates.
Currently I need a lot of trial and error to place the lines at the desirable positions on the “scene”, which is because I don’t know how to relate the user-coordinate positions within the axes to the “scene” coordinates.
Plotting to a Scene is no different from plotting to an Axis. An Axis just keeps track of a few things to update itself before placing your plot in axis.scene.
You can transform data coordinates from a given scene into (global) pixel coordinates with Makie.shift_project(ax.scene, pos) or Makie.shift_project(ax.scene, ax.scene.plots, pos) dependeing on the Makie version. That’s an internal function though, so it’s not documented.