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
8
votes
1 answer

geom_rect missing when converting ggplot2 to ggplotly

I'm trying to put together a ggplotly graph with three elements (geom_point, geom_line, and geom_rect) and it looks fine in ggplot2. However, when I convert to ggplotly, the geom_rect disappears. I'm thinking it's something with the inherit.aes…
Agrosel
  • 489
  • 3
  • 15
8
votes
2 answers

How to make scatterplot points open a hyperlink using ggplotly - R

I'd like to make my scatterplot points clickable and have each point's respective hyperlink open when clicked. I am trying to do this using ggplotly. There is a simple way to do this when building the plot using plotly()(see first example below).…
Margo
  • 93
  • 4
8
votes
2 answers

Python ggplot and ggplotly

Former R user, I used to combine extensively ggplot and plot_ly libraries via the ggplotly() function to display data. Newly arrived in Python, I see that the ggplot library is available, but cant find anything on a simple combination with plotly…
GKerv
  • 81
  • 3
7
votes
0 answers

keep two legends from ggplot plot using plotly::ggplotly

When I convert a ggplot with two separate legends to plotly (using ggplotly), the two legends merge. Does anyone know how to prevent this? library(tidyverse) library(plotly) df <- data.frame(date = as.Date(c("01/01/1998",…
user63230
  • 4,095
  • 21
  • 43
7
votes
0 answers

ggplotly like function for python

In R there's a function (ggplotly), that converts ggplot2 plots to plotly graphs. In python you have plotnine for using ggplot, but is there a similar converter like ggplotly? There is a similar question, but is asking about the older (and I think…
fbence
  • 2,025
  • 2
  • 19
  • 42
7
votes
1 answer

How to use plotlyProxy() in shiny app with ggplotly() to make plots render faster

I have been looking for a question that deals with this but I haven't seen any.. I am creating a shiny app which uses ggplotly() to make my graph interactive. The graph is reactive based on a user selectInput() drop down menu. Everything works fine…
NBE
  • 641
  • 2
  • 11
  • 33
7
votes
1 answer

Linked plots without using Shiny

I have created a shiny app to show a correlation heatmap for a large dataset. When the heatmap tiles are pressed, the corresponding scatterplots are displayed. However, I need to make several of these apps and this exceeds my limit of publishing on…
J.Con
  • 4,101
  • 4
  • 36
  • 64
7
votes
2 answers

Format hover data labels Plotly R

I am trying to format the data labels that appear when I hover over part of a chart I have created using Plotly. The label is currently showing like this. I would like for the label to only show profit. My code for creating the plot…
Mavic
  • 153
  • 2
  • 2
  • 6
7
votes
1 answer

Plotly cutting off X and Y labels

I have a plot which I have created with plotly. When I deploy it to my shiny app the X and Y labels are cut off as you can see here: How can I prevent this from happening? If I use a normal plot the labels do not get cut off but I need the plot to…
Mavic
  • 153
  • 2
  • 2
  • 6
7
votes
0 answers

Export plotly to powerpoint in R

Is it possible to export plotly/ggplotly plot to Powerpoint and keep its interactivity? I mean by that for example to allow user to change colors of plot lines, thickness, etc. Example code: set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000),…
Taz
  • 5,755
  • 6
  • 26
  • 63
7
votes
1 answer

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

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…
Dollar Vora
  • 197
  • 1
  • 10
7
votes
2 answers

Shiny R - ggplotly - Show custom message instead of empty plot when the dataset does not return any information

The shiny application I'm working on is displaying graphs using ggplotly. In an instance when the resulting dataset is empty, a blank plot is being displayed, as below. Is it possible to show a custom message such as "No data exists with the…
Prashanth kumar
  • 949
  • 3
  • 10
  • 32
6
votes
3 answers

R plotly separate functional legends

I want to produce a plot via R plotly with independent legends while respecting the colorscale. This is what I have: library(plotly) X <- data.frame(xcoord = 1:6, ycoord = 1:6, score = 1:6, gender =…
mat
  • 2,412
  • 5
  • 31
  • 69
6
votes
2 answers

Dynamic creation of tabs in Rmarkdown does not work for ggplot while it does for plotly

I've been willing to dynamically create tab contents in rmarkdown. I've created an in_tabs that seems to work for everything but ggplot plots. The way it works is that it creates the Rmd code necessary to display nested lists in tabs. The following…
statquant
  • 13,672
  • 21
  • 91
  • 162
6
votes
2 answers

Create interactive bar chart with shared data filtered by time range

I want to create an interactive bar chart that lets users filter observations based on a range of values, and then renders counts per class for the selected time period dynamically. Since the filtered data needs to be available for numerous such…
fdetsch
  • 5,239
  • 3
  • 30
  • 58
1
2
3
53 54