ggplotly

Use a custom icon in plotly's pie chart in R

ぃ、小莉子 提交于 2019-11-29 08:08:27
I was wondering if there's a way to have a custom icon for plotly's pie chart instead of the usual pie division As of now I'm displaying the gender information using a pie chart which looks as below: I'm trying to make it look like the gender plot in the link below: https://app.displayr.com/Dashboard?id=c1506180-fe64-4941-8d24-9ec4a54439af#page=3e133117-f3b2-488b-bc02-1c2619cf3914 The plotly code is as under: plot_ly(genderselection, labels = ~Gender, values = ~Freq, type = 'pie') %>% layout(title = paste0("Gender Distribution of Patients from Boston"), xaxis = list(showgrid = FALSE, zeroline

Customizing the sankey chart to cater large datasets

隐身守侯 提交于 2019-11-28 14:50:42
kindly run the script below, I have created a Sankey chart in R and plotly using data from "patients" dataset of the bupaR library. Please see the snapshot for reference. The issue I am facing is that, this custom plot has been built by declaring and building each and every relationship between users("r1","r2",etc.) and activities("Registration","X-Ray, etc). If I have a large number of users and activities, it will become a very tedious task to declare each and every relation. Please help me in modifying the plot dynamically such that I can replicate the code for large number of users and

Shiny update the clicked point to highlight it

浪尽此生 提交于 2019-11-28 05:55:36
问题 Here is a working example of extracting the on-click event. I would like to ask you if there is a way to update the clicked point with either increase in size or highlight it etc.,? library(shiny) library(plotly) ui <- fluidPage( plotlyOutput("plot"), verbatimTextOutput("click") ) server <- function(input, output, session) { nms <- row.names(mtcars) output$plot <- renderPlotly({ p <- ggplot(mtcars, aes(x = mpg, y = wt, col = as.factor(cyl), key = nms)) + geom_point() ggplotly(p) }) output

Use a custom icon in plotly's pie chart in R

孤街醉人 提交于 2019-11-28 02:10:20
问题 I was wondering if there's a way to have a custom icon for plotly's pie chart instead of the usual pie division As of now I'm displaying the gender information using a pie chart which looks as below: I'm trying to make it look like the gender plot in the link below: https://app.displayr.com/Dashboard?id=c1506180-fe64-4941-8d24-9ec4a54439af#page=3e133117-f3b2-488b-bc02-1c2619cf3914 The plotly code is as under: plot_ly(genderselection, labels = ~Gender, values = ~Freq, type = 'pie') %>% layout

How to choose variable to display in tooltip when using ggplotly?

自作多情 提交于 2019-11-27 11:22:41
I have a simple data frame: seq <- 1:10 name <- c(paste0("company",1:10)) value <- c(250,125,50,40,40,30,20,20,10,10) d <- data.frame(seq,name,value) And I want to plot it this way: require(ggplot2) ggplot(data = d,aes(x=seq,y=value))+geom_line() + geom_point() Now I want to use plotly, mostly to be able, when mousing over a point, to get other information than the value, such as the company name. I try this : require(plotly) ggplotly() which get me a tooltip, but with only seq and value. I tried the option tooltip= but it's specified you can use the only variable describe in the aesthetic,