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

R - convert ggplot piechart into plotly

I am having trouble trying create the same ggplot pie chart in plotly, as I need plotly's interactive on-hover capability to view the details of a pie chart segment. It appears plotly will render a gpplot piechart as a bar chart due to the presence…
Z Oscar
  • 31
  • 8
0
votes
1 answer

GGPlot won't display more than 3 colors

GGPlot is only displaying the first three colors (green, yellow, and orange) with the following code: p = ggplot(MobileOutput, aes(x=`Timestamp(UTC)`,y=`PM2.5(ug/m3)`))+ geom_point(aes(colour = cut(`PM2.5(ug/m3)`, c(0, 12.0, 35.4, 55.4, 150.4,…
Brandogs
  • 145
  • 13
0
votes
0 answers

rangeslider in ggplotly(): start and end of slider doesn't work

I want to use rangeslider() with ggplotly(). Unfortunately, defining the start and end of the slider does not work with ggplotly(). I'm using the rangeslider() in the server.R of an RShiny App. In the server it looks like the following code…
MikiK
  • 398
  • 6
  • 19
0
votes
1 answer

How to customize hover info while using ggplotly() from plotly package in R?

I am adding a layer of points to a plot made originally in ggplot2 but that I transformed through plotly package into a plotly object. The hover shows info I do not need (points coordinates) and there is a couple o variables that I need to show its…
Mendi
  • 3
  • 4
0
votes
1 answer

Change sizing policy of a widget in R and save it

I use saveWidget function in htmlwidgets to save HTML widgets in R. This worked fine. Since I want to reduce the browser padding to 0, I changed it by adding fig.g <- fig.g %>% sizingPolicy(browser.padding = 0) I don't get an error message at this…
an_ja
  • 427
  • 2
  • 13
0
votes
0 answers

How to make surface plot with table of x y z values in R

I have a table of data like this in a dataframe: https://gofile.io/d/JdfbJ8 It is of the following form x y z -4.0965350229 3.3847132724 0 -1.9223487932 -12.7011913854 2.5830465849 -1.0243678647 …
Milk Man
  • 73
  • 5
0
votes
1 answer

How to remove legend entry in hovering display when using ggplotly

I have created the following graph using ggplotly. I am looking for a solution whereby I can remove the legend entry in the hovering display. I would only like the hovering display to show the date (x axis) and value (y axis). p1 <-…
sa90210
  • 525
  • 2
  • 12
0
votes
1 answer

How to add a moving average on one variable using ggplot2 and plotly

I have created a plot using ggplot and plotly. I have two variables in my dataset and I would like to add a 12 month moving average of one of the variables (headline inflation in this case). I believe that geom_ma is not supported in plotly so I'm…
sa90210
  • 525
  • 2
  • 12
0
votes
1 answer

How to reorder the legend in ggplot and pltly?

I have quite a simple question but I am not sure how to solve it : I am plotting likert scale bar graph. likert_results2 <- structure(list(Survey = c("Post survey \nN= 274", "Post survey \nN= 274", …
yuliaUU
  • 1,581
  • 2
  • 12
  • 33
0
votes
1 answer

Unable print the data frame under the graphique with hover option (in R Shiny)

I have a data frame which look like that : Taux_retour = as.Date(c("2020-06-11", "2020-06-12", "2020-06-13", "2020-06-15", "2020-06-16", "2020-06-17", "2020-06-18", "2020-06-19", …
so_so
  • 1
0
votes
2 answers

How to render plot from other packages such as DiagrammeR in R Shiny?

I'm trying to create a plot in Shiny, but it is not working. It is blank. I think it is because lavaanPlot uses DiagrammeR svg graphics. Here's the code library(shiny) library(lavaan) library(lavaanPlot) ui <- fluidPage( titlePanel("Text…
writer_typer
  • 708
  • 7
  • 25
0
votes
1 answer

Bubble Chart using ggplotly - Changing the labels using a slider

First of all here is my data: df <- structure(list(rowname = c( "AA - 2018", "AA - 2019", "AA - 2020", "AB - 2018", "AB - 2019", "AB - 2020" ), Class = c( "AA", "AA", "AA", "AB", "AB", "AB" ), Year = c( 2018L, 2019L, 2020L, 2018L, 2019L,…
Dinks123
  • 145
  • 1
  • 14
0
votes
0 answers

Strange behavior with shiny and ggplotly axis labels

Sorry if this has been echoed elsewhere, I can't seem to find any info on this. I found a strange bug when creating an interactive markdown document with RMarkdown, shiny, and plotly. Basically when I have a selectInput tab in the document which is…
John Harley
  • 156
  • 1
  • 6
0
votes
1 answer

Get the unquoted value of a string variable inside of aes() call

I would like to generate a hovertext for ggplotly() using aes() along the lines of mapping <- aes(text = paste0( "Value: ", columnName )) where columnName is a variable containing a column name as a string. Now, I don't want columnName…
NiklasvMoers
  • 309
  • 2
  • 13
0
votes
1 answer

Plotly is not reading ggplot output well

I am using the following code to plot some data points and it works well in ggplot. However, when I feed this into ggplotly, the visualization and Y-axis labels change completely. Y-axis label shift to right and gets flipped, and the lines in the…
ferrelwill
  • 771
  • 2
  • 8
  • 20