I’d like to add an image to the center of a polar chart. This seems straightforward, however it seems the image is always added in a cartesian coordinate system which makes it difficult to align it correctly. More importantly, when zooming/resizing, the two coordinate systems seem to behave in a slightly different way and the position of the image becomes incorrect.
A very basic example of what does work as long as you don’t zoom or resize:
library(plotly) fig <- plot_ly( type = 'scatterpolar', r = c(0,1,2,2), theta = c(0,45,90,0), mode = 'markers' ) fig |> layout( images = list( list( source = "https://images.plot.ly/language-icons/api-home/r-logo.png?raw=true", xref = "x", yref = "y", x = 0.2, y = 3, sizex = 2, sizey = 2, sizing = "stretch", opacity = 1, layer = "above" ) ) )
What I’d like to get to work is this: Posit Connect. This plot looks fine when viewed in full screen, however when zooming the image moves away from the center.
Is there a way to fix this?