Show subtitle in tooltip when hovering over diffuse diagram in Rbokeh

I am creating an interactive scatter plot with Rbokeh. My data is stored in a data table.

data(iris)
library(data.table)
dt.iris <- data.table(iris)
library(rbokeh)
figure() %>%
  ly_points(Sepal.Length, Sepal.Width, data = dt.iris, 
            hover = c(Petal.Width, Petal.Length,Species)) 

      

Instead of printing numeric or string values ​​in the tooltip on hover, as implemented in the above code, I would like to draw the subtitle tooltip associated with this datapoint. For example, if the data point I was targeting corresponds to the aperture dataset. Breeds are "versicolor", the subheading should be something like Petal.Width and Petal.Length for all data points that are also "versicolor".

Related post:

Interactive scatterplots in R, pivot / hover overlay / tooltip as user-provided function

There is an answer from this post that uses the packages in a systematic and brilliant way together, but I would like to show my plot in a hint . Also, I would rather avoid using Plotly if possible.

+3


source to share





All Articles