Set plotly marker size / annotation size based on x axis, not pixel counts
This is a simple question, that I've asked about previously, but that I wanted to revisit. See the following graph made in R's plotly:
mydf = data.frame(x = 1:5, y = 1:5) plot_ly(mydf) %>% add_trace(x = ~x, y = ~x, type = 'scatter', mode = 'markers', marker = list(size = 24)) %>% layout(annotations = list(text = 'Over Here', x = 2, y = 3, font = list(size = 24)))
When this plot is zoomed, the marker sizes remain the same, as does the annotation, and this is because the size parameters are set in pixel sizes. I am interested in having the marker sizes be based on the axis values, rather than a pixel count.
For example, I would like for the size of the markers to always have a height and width of 0.5 relative to the axes. The marker plotted at x = 3, y = 3 would then have a size such that it extends from x = 2.75 to x = 3.25, and from y = 2.75 to 7 = 3.25.
I do not see any way currently to set the marker sizes based on the coordinate scale of the plot, only based on the pixel width. My previous post here - Set marker size based on coordinate values, not pixels, in plotly R - got no responses, but this is an issue i'd still very much like to resolve.