r-plotly

How can I plotly a ggplot treemap?

自作多情 提交于 2020-06-26 22:31:52
问题 I am looking to get this gradient colors on the map: ramp <- colorRamp(c("royalblue4", "white")) ramp.list <- rgb( ramp(seq(0, 1, length = 15)), max = 255) But also, and more important, I am looking to add plotly charactheristics to the graph (specially hovering text output). This is my data: structure(list(V1 = structure(c(9L, 8L, 4L, 7L, 2L, 6L, 1L, 3L, 5L, 10L, 13L, 11L, 12L), .Label = c("Apple", "Avocado", "Banana", "Carrot", "Mango", "Mushroom", "Onion", "Orange", "Pineapple",

Hover image in plotly r chart in shiny app

丶灬走出姿态 提交于 2020-06-24 12:40:38
问题 Does anyone here have an example of showing an image when hovered on a plot or any package which can do this? I have tried something but it will show url only but not the image.I know this code is just encasing the URL. How can I build a div to show the image. library(shiny) library(shinydashboard) library(DT) library(dplyr) library(plotly) # Data ------------------------------------------------------------------ dt <- data.frame(fruits = c("apple","banana","oranges"), rank = c(11, 22, 33),

Plot multiple legends in R-plotly

旧巷老猫 提交于 2020-06-23 11:16:00
问题 I have 5 continuous variables that I'd like to graph together in R plotly. I wrote the following code and got the plot to run as expected, but I cannot figure out how to deal with the legends. As is, the color legend appears, but the size legend does not. I would like to plot both legends and control their locations within the plot. Suggestions from a similar post Adding color and bubble size legend in R plotly do not solve the problem. Here's the code and sample data: x<-sample(30) y<-sample

Plot multiple legends in R-plotly

只谈情不闲聊 提交于 2020-06-23 11:14:34
问题 I have 5 continuous variables that I'd like to graph together in R plotly. I wrote the following code and got the plot to run as expected, but I cannot figure out how to deal with the legends. As is, the color legend appears, but the size legend does not. I would like to plot both legends and control their locations within the plot. Suggestions from a similar post Adding color and bubble size legend in R plotly do not solve the problem. Here's the code and sample data: x<-sample(30) y<-sample

Is there a way to read images stored locally into Plotly?

倖福魔咒の 提交于 2020-05-15 21:19:40
问题 In the code below another user has successfully demonstrated a workaround on how to load an image URL into a Plotly graph. The image data is taken from the data frame and then, by employing the custom data tool, appears as a tooltip on hover at each data point in the graph. Is there a way to do something similar using images stored locally, simply using the file directory? library(shiny) library(shinydashboard) library(plotly) # Data -----------------------------------------------------------

How to add fixed horizontal and vertical lines to a scatter plot in plotly

谁说胖子不能爱 提交于 2020-05-15 09:25:08
问题 I have the following code producing a scatter plot and I would like to add both vertical and horizontal lines representing the mean values of the y axis and x axis, how could I do that? f <- list( family = "Courier New, monospace", size = 18, color = "#7f7f7f" ) x <- list( title = "Age of Buildings", titlefont = f, zeroline = FALSE, showline = FALSE, showticklabels = TRUE, showgrid = TRUE ) y <- list( title = "Total Violations", titlefont = f, zeroline = FALSE, showline = FALSE,