You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we create a ggplot2 object with colors based on scale_fill_gradientn, then ggplotly respect the colors. But if the limits are set to be within (instead of outside) the range of the data, then ggplotly stops respecting the colors. This may be some fallback for how to deal with NA colors (but I don't know enough about ggplotly to know for sure).
Here is a self contained example:
library(ggplot2)
library(viridis)
library(plotly)
# Equivalent fill scales do the same job for the fill aestheticp<- ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill=density)) +
scale_fill_gradientn(colours= viridis(10), limits= c(0.001,.01))
p
ggplotly(p)