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
2 answers

ggplot polygon X- and Y- axis scaling and change color of groups

-How can I scale the Y- and X- axis to 0,30 and 0,50 respectively and plot the data point according to the scale? -How do I change the color of groups 1, 2 and 3 to purple, orange and yellow? library(ggplot2) library(plotly) ID <- c("Group 1",…
Nivel
  • 629
  • 4
  • 12
0
votes
0 answers

Curved lines appearing after log transform in ggplot when values are interpolated in R

I have created the following dataframe library(data.table) require(wrapr) library(readxl) library(dplyr) library(tidyr) library(ggplot2) library(plotly) df <- data.frame("X_Frequency" = c(5, 10, 55, 180, 300, 360, 1000, 2000) , …
Raghavan vmvs
  • 1,213
  • 1
  • 10
  • 29
0
votes
1 answer

How to fix ggplotly rendered from pickerInput and other Input in shiny?

My plot is totally false when I ran my shinyapp. I have selected all the "country" variable using ShinyWidget's pickerInput, and it was supposed to generate a geom_col stacked plot with all the country on the x-axis, the value of the available…
0
votes
0 answers

Embedding interactive ggplotly chart on website

I have created an interactive chart with ggplotly in R, but now am unsure how to embed this in a website. How do I get the html code for the interactive chart? Do I need to knit it? Or is there a way to get the standalone html code without kniting…
matt_lnrd
  • 329
  • 1
  • 9
0
votes
1 answer

ggplot2 combining multiple chart types into single chart

I am new to R and was fascinated by ggplot2 in combination of plotly. In the below code I am trying to do a box plot jitter with label of WAMP from dataset. I seem to get most of it except the fact that i am unable to sort the x axis by Size and…
Manny
  • 63
  • 3
  • 9
0
votes
1 answer

Is there a plotly function that switches the legend and color of a plot based on different conditions in the data frame?

I have two plots that are identical except for the colour referenced in aes(). I would like to use plotly to toggle between the two plots' color schemes. How might I do this? require(ggplot2) require(plotly) #DF Construction col1 <- c(84, 55, 69,…
0
votes
2 answers

Interactive histogram with a filter (button) on some other variable (ggplot2 and plotly)

I use the mtcars dataset as an example. library(tidyverse) library(plotly) plot <- mtcars %>% ggplot() + geom_histogram(aes(mpg), binwidth = 3) ggplotly(plot) What I would like to do is to have a filter on, e.g. the am variable so I can…
xhr489
  • 1,957
  • 13
  • 39
0
votes
0 answers

Plotly.r & ggplot2: when clicking the legend in a plot made via ggplotly, it fails to update ranges and bar positions after cases are withdrawn

(Based on the "Add Lines" example found here: https://plot.ly/ggplot2/geom_histogram/. It is also similar to this Q, which has no satisfactory anwser for me, since I need to use the ggplot features, like being able to use log scale in the x-axis) In…
Juan
  • 1,351
  • 1
  • 14
  • 28
0
votes
1 answer

R 1 column with bar chart the other 3 as lines on the same chart

I have a dataframe with a date for the x axis and would like to plot the count as a barchart(vertical) and the mean,lower_conf, and upper_conf as horizontal lines. The following is my dataframe. Date Count Mean X95_lower_conf …
sectechguy
  • 2,037
  • 4
  • 28
  • 61
0
votes
0 answers

ggplotly does not provide an interactive population pyramid

Using ggplot, I could create a population pyramid within Shiny framework which works perfectly. I tried to make it fancier using ggplotly, but could not get proper results. Here are the successful codes. pyramidPlot <- reactive ({ ggplot (pyramid(),…
Nader Mehri
  • 514
  • 1
  • 5
  • 21
0
votes
1 answer

Is it possible to make plotly to show additional information when hovering over titles?

Using an example from"https://plot.ly/r/" library(plotly) d <- diamonds[sample(nrow(diamonds), 1000), ] p <- ggplot(data = d, aes(x = carat, y = price)) + geom_point(aes(text = paste("Clarity:", clarity)), size = 4) + geom_smooth(aes(colour = cut,…
Patrick Balada
  • 1,330
  • 1
  • 18
  • 37
0
votes
1 answer

rendering plotly in Shiny correctly, only 1 of multiple plots rendering

Running the below code as a app.r renders a ggplotly for p2 in a shiny app, but not p1, though p1 does render in the RStudio plot pane. I want to be able to get plotly plots of p1 and p2 in the app and on Shiny. What am I…
dbo
  • 1,174
  • 1
  • 11
  • 19
0
votes
0 answers

Plotly can't show on shiny (I have downloaded the patched file. But the problem is the same as usual.)

library(shiny) library(plotly) library(dplyr) library(scales) library(reticulate) source_python("cems_api.py") ui <- fluidPage( plotlyOutput("plot") ) server <- function(input, output) { # renderPlotly() also understands ggplot2 objects! …
Karen
  • 7
  • 5
0
votes
0 answers

which "geom_" one need use to create plot shown below

I need to make a plot as shown in figure2, I tried changing multiple "geom_" functions. Can I get help? I'm able to plot something like this using : my_data$Genus = factor(as.character(my_data$Genus), levels=names(x)) ggplot(my_data, …
rahul
  • 81
  • 1
  • 1
  • 3
0
votes
0 answers

No results for plotly/shiny in Rstudio

The question has confused me for about 1 months or more. When I try to get a plotly or shiny object with the package in Rstudio, nothing appeared in the Viewer window. For the plotly, I can get the correct result in Rgui, while it it doesn't work…
Jiaao Yu
  • 1
  • 2