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

grid.arrange with ggplotly

I was wondering if there is a workaround to get the layout of the plots that we get using grid.arrange using ggplotly. The resulting object from grid.draw is not a ggplot object obviously. So, wondering for any workarounds to pass the following plot…
let_there_be_light
  • 837
  • 3
  • 9
  • 15
3
votes
1 answer

ggplotly with histogram -- cannot make it work

I am trying to animate a histogram with an overlaid density function via ggplotly, using a code that looks like ggplot() + geom_point(data_1 = aes(..some aesthetic.., frame = step)) + geom_hist(data_2 = aes(..some other aesthetic.., frame =…
qubert
  • 83
  • 5
3
votes
2 answers

generate seasonal plot, but with fiscal year start/end dates

Hello! Is there a way to index a chart to start and end at specific points (which may be out of numeric order)? I have data that begins October 1st, and ends September 31st the following year. The series repeats through multiple years past, and i…
Joe
  • 349
  • 1
  • 2
  • 11
3
votes
1 answer

Reduce file size of a plot (R) (plotly)

I've created a map in R using ggplotly. To create a link, it needs to be 524kb or under, but it currently is 1.2Mb. Are there any good ways of reducing file size so I can export it? Or is this totally unrealistic?
Jaccar
  • 1,720
  • 17
  • 46
3
votes
0 answers

Multiple axis.text.x names coloring does not work with ggplotly()

I have a data frame: HG44 <- data.frame( gene_symbol = c("sads","sdsds","sdasdad","dfds","sdsdd"), panel = c("big","gr","sm","big","big"), variable = c("x","x","y","z","y") , value = c("normal","over","low","normal","low") , colors =…
firmo23
  • 7,490
  • 2
  • 38
  • 114
3
votes
0 answers

How to get a single Interactive Correlation scatterplot matrix triangle with R ggpairs and plotly

I am attempting to get an interactive scatterplot matrix for ~5 variables I am interested in seeing how the observations of each correlate with each other, and to spot and identify outliers. The problem is that plotly is behaving unpredictably, in…
andemexoax
  • 323
  • 3
  • 15
3
votes
1 answer

how to add points to stacked barplots

I would like to add points (the variable nb species) on my already existing chart. I tried to add the points with the function geom_point but unfortunately i have this error: "Discrete value supplied to continuous scale". You will find below my…
Elodie P.
  • 73
  • 1
  • 4
3
votes
1 answer

How do I format the names of the variables in the R plotly tooltip?

I have been trying to make a map of the U.S. with a superimposed scatterplot of shootings with both the number of people killed and injured in the hoverinfo label of each point. However, the label pops up as "num_killed" and I would like to format…
TrigonDark
  • 184
  • 2
  • 9
3
votes
1 answer

Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported

Please find below a reproductible example to explain my issue (I am using manipulateWidget R package which is directly related to Shiny R package): library(ggplot2) library(plotly) library(manipulateWidget) library(data.table) my_data <-…
JeanBertin
  • 633
  • 1
  • 7
  • 23
3
votes
1 answer

Change axis title position in ggplot using plotly

I have an issue when using ggplotly on a ggplot graph. It is basically the exact same issue as here. However, the offered solution does not work if the plot is not facetted, since the object gp[['x']][['layout']][['annotations']] that should be…
Bart VdW
  • 438
  • 8
  • 17
3
votes
0 answers

ggplotly - mismatching when using color aesthetics

I'm using ggplotly to convert a ggplot object to interactive plotly. The problem I'm encountering is when the ggplot object is using an associated color aesthetic. For example, using the following dummy…
zek
  • 73
  • 5
3
votes
1 answer

Creating Sankey Diagram using ggplot2, plotly and ggplotly

I want to create a sankey diagram using ggplot2 and plotly and call using ggplotly. I would require some good working examples with some crucial links.I have implemented one in plotly and this is the snap I achieved. Please help and thanks. Editing…
Ashmin Kaul
  • 860
  • 2
  • 12
  • 37
3
votes
1 answer

How to plot a line with color vector in R Plotly

Say I have the following data frame: ret <- rnorm(100, 0, 5) df <- data.frame( x = seq(1, 100, 1), ret = ret, y = 100 + cumsum(ret), col = c(ifelse(ret > 0, "red", "forestgreen"), NA)[-1] ) Here I'm simulating the returns of some fictional…
Travis L
  • 57
  • 7
3
votes
0 answers

Difficulty understanding the ggplotly interface for custom geoms

I've had some success extending ggflags to use SVGs, and now I'm trying to make this extension play nice with ggplotly(). The Plotly documentation has a nice section on translating custom geoms, and it essentially comes down to either providing a…
jimjamslam
  • 1,988
  • 1
  • 18
  • 32
2
votes
2 answers

Add custom lines to geom_violin in ggplot / ggplotly

I have thresholds for each of the groups of my data, and when plotting a violin plot I would like these to be shown within the plots. Instead, the lines are not constrained to the corresponding groups and the lines are only shown either full width…
Beavis
  • 476
  • 3
  • 13