Fix the hover box

How can I fix the hover box position like legend() in the top right corner rather than moving next to the mouse pointer?

I don’t think there’s an available option for this. But it’s possible to create a customized app to display the hoverinfo where you want. For example, this is created using the hover events in R Plotly: https://plot.ly/r/shiny-coupled-hover-events/