Using ggplot2 and Plotly, you can set text . You will want to install Plotly and get the key . Here are two examples. Example 1:
data(canada.cities, package="maps") viz <- ggplot(canada.cities, aes(long, lat)) + borders(regions="canada", name="borders") + coord_equal() + geom_point(aes(text=name, size=pop), colour="red", alpha=1/2, name="cities") ggplotly() ggplotly(filename="r-docs/canada-bubble")
This gives this plot with the name of Canadian cities available in guidance mode.

Example two:
install.packages("gapminder") library(gapminder) ggplot(gapminder, aes(x = gdpPercap, y = lifeExp, color = continent, text = paste("country:", country))) + geom_point(alpha = (1/3)) + scale_x_log10() ggplotly(filename="ggplot2-docs/alpha-example")
What gives this plot .

For more information, see our R docs or this question on how to overwrite the hover_text element. The Plotly native R API allows you to add more controls to your stories. Thanks for asking Brian. We will also add a new section to our docs about this. Disclaimer: I work for Plotly.
source share