Questions tagged [ggplotly]

ggplotly is a function which converts a ggplot object into an interactive plotly object. It enables the usage of functions like zoom, hover, playing with the axis, appearing/disappearing group of points.

For more information and examples, please visit the website.

799 questions
0
votes
1 answer

ggplotly tooltip showing NA value

I am developing my first app using R-shiny. I am using ggplotly to make interactive plots. For some reason, the tooltip shows the numerical value as NA. I am trying to calculate the sum of people who died in civilian aircraft and military aircraft…
Deepansh Arora
  • 724
  • 1
  • 3
  • 15
0
votes
0 answers

Category data is displaying as number in R

I am having below R code. when I am plotting this in power BI desktop it is working fine as Reason col is coming as category. When I am publishing same in power BI service, Reason is converted into the number and date col is also changed. attached…
Andrew D
  • 37
  • 6
0
votes
1 answer

boxplot annotation to outliers using r plotly

Using the iris dataset below how do I get the ID of the flower on hover of the outliers library(plotly)? I've tried something like: iris_ids <- iris %>% mutate(id = rownames(iris)) plot_ly(iris, y = ~Sepal.Length, x= ~Species, type = 'box') %>% …
MayaGans
  • 1,815
  • 9
  • 30
0
votes
1 answer

Issues with ggplotly within Shiny context

Using the code below, I could create the plot shown in the image. I am trying to fix some issues as follows: 1- How can I place the legend between title and plot. I would like to have the legend in a horizontal format rather than the current…
Nader Mehri
  • 514
  • 1
  • 5
  • 21
0
votes
1 answer

can stat_poly_eq() be added to plotly plot?

One can easily include stat_poly_eq() in ggplot, but is there any way to include this on a plotly plot? When I tried using ggplotly, it does not render stat_poly_eq(). Or should I use a different function in the case of plotly?
kolas0202
  • 163
  • 1
  • 7
0
votes
0 answers

Dynamic plots and tables inside Rmarkdown

I am new to Rmarkdown and shiny and forgive me for some naive questions. I have build a code in two parts first where I do all the processing and second where I call the Rmarkdown to knit it. The first code example.R is as follows and works fine…
Angelo
  • 4,829
  • 7
  • 35
  • 56
0
votes
1 answer

Gathering the Averages and Combining multiple Line Graphs

I am new to R and I would love some assistance on this. I am using this dataset: https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-01-29/clean_cheese.csv I am trying to first find the Average of the following…
Marce
  • 91
  • 7
0
votes
1 answer

Stat-smooth tooltip with ggplotly fails when creating a new text argument

I'm doing a Shiny app, but in the spirit of making a minimal reproduceable example, I took the Shiny part out. This is just context. I want to make a plot with the ggplotly() function. It works fine until I try to change the tooltip. Without that,…
Érico Patto
  • 1,015
  • 4
  • 18
0
votes
1 answer

R: Long tick mark labels in ggplotly are not properly shown

These tick mark labels are too long and they are always shown in a single line. How could I have each one of them with a line break? That way, the image can be shown bigger and the x-axis tick mark labels would be…
user284437
  • 129
  • 5
0
votes
1 answer

How do I customize the tooltip in ggplotly?

I'd like to round the values in the tooltip for ggplotly. I have code and when you hover over a column, it shows the full value. I checked the docs but I had a hard time finding instructions. This is my…
tadon11Aaa
  • 400
  • 2
  • 11
0
votes
1 answer

How to Change the Tooltip in ggplotly to show SUM of a Column in a Bar Chart

I have this bar chart rendered using ggplot and ggplotly() It renders just the way I want, in that it displays the SUM of total crashes by Mode Type and Year. But, I am struggling with getting the (hover) tooltip to display the SUM of the Total…
myClone
  • 1,609
  • 5
  • 17
  • 28
0
votes
1 answer

R: overlapping tooltips when hovering in ggplotly

I have this code. Basically, when mousing over the ggplotly plot in the value=50, I have two labels overlapping each other so basically I cannot see the West label, only the South. How can I prevent that from happening? What am I doing wrong? I…
user284437
  • 129
  • 5
0
votes
1 answer

Creating a line chart with monthly data unerneath the x axis

I'm trying to create a chart as under: The data set is as below: +-----------+------+------------+------------+------------+ | | Week | S19 retail | S20 target | S20 retail | +-----------+------+------------+------------+------------+ |…
user11845701
  • 157
  • 1
  • 9
0
votes
0 answers

ggplotly in R studio fail to show results in viewer

I am trying to use the ggplotly to convert ggplot object and it returns nothing, just a blank viewer... Can anyone tell me why? Thanks in advance. ggp = ggplot(data = mtcars, aes(cyl)) + geom_density(kernel = "gaussian") ggplotly(ggp)
user8330379
0
votes
1 answer

ggplotly in shiny app keeps crashing (Rstudio)

I am trying to render a ggplotly in a shiny app, but my code doesn't even run. Any help is highly appreciated! Where am I making a mistake? I am very new to R. See my code below. ** ui <- fluidPage( …
sal461
  • 19
  • 2