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

The ggplotly() deactivates distance between axis title and axis and hides secondary axis title

I have the dataframe below and Im trying to increase the distance between axis title and y axis. This my approach but its not working when using ggplotly(). Also the secondary axis title is getting lost. How can I fix…
firmo23
  • 7,490
  • 2
  • 38
  • 114
2
votes
2 answers

Suppress warning "'heatmap' objects don't have these attributes: 'mode'"

The following Shiny app combining ggmap and plotly with heatmap: require(ggplot2) require(plotly) require(ggmap) require(shiny) server = function(input, output, session, module_input) { output$map = renderPlotly({ d = data.frame(lon =…
geotheory
  • 22,624
  • 29
  • 119
  • 196
2
votes
1 answer

Display a tooltip with percent of total number of observations on ggplot histogram?

I have a histogram and I'd like the tooltip to show the percent of observations in that bin. Here's a simple (reproducible) histogram: library(tidyverse) library(ggplot2) library(plotly)   hist <- iris %>%   ggplot(aes(x = Sepal.Length)) +  …
stevec
  • 41,291
  • 27
  • 223
  • 311
2
votes
1 answer

ggplotly not working in shiny app, plot not showing up

I'm currently making a Shiny app and I tried to use this graph (this is used in the server): output$COTY_out1 <- renderPlot({ data %>% group_by(year) %>% summarize(mean_ls = mean(life_satisfaction, na.rm = TRUE)) %>% …
BoyAcc
  • 193
  • 7
2
votes
0 answers

ggpubr ,ggpp, ggformula functions not working with ggplotly

I am using a few functions from ggpubr and ggpp to draw my plots. Specifically, i am using the functions: geom_quadrant_lines(), stat_quadrant_lines(), geom_lm, stat_regline_equation in my plot. However, when i convert my ggplot2 object into a…
K.RAC
  • 233
  • 1
  • 8
2
votes
1 answer

ggplotly showing numbers instead of date labels

I have a dataset with the following structure: structure(list(mes = c(7, 7, 7, 4, 4), ano = c(2021, 2021, 2021, 2021, 2021), nacionalidad = c("Venezuela", "Venezuela", "Venezuela", "Venezuela", "Venezuela"), centro = c("Aeropuerto Eldorado",…
ntcha
  • 41
  • 3
2
votes
2 answers

ggplotly stacked bar chart not resizing after filtering

For some reason when producing a plotly graph with the ggplotly function, the filtering does not seem to resize the y-axis. The filtered portion are simply removed, while yaxis stays at it's original length. Please see this…
AOE_player
  • 536
  • 2
  • 11
2
votes
1 answer

ggplotly removing observations from ggplot

I am trying to create a graph showing the number of citations that papers from a department have received. I want it to be an interactive plot so more information is displayed when hovering a particular entry. The papers with few citations are…
2
votes
1 answer

plotly::subplot annotations titles disappear in R Shiny

I have made a Shiny Application which includes an interactive plot via ggplotly in R. For plotting two of these interactive plots together I used plotly::subplot. Subplot works fine as intended, however the titles of the two disappear in the Shiny…
Ed_Gravy
  • 1,841
  • 2
  • 11
  • 34
2
votes
1 answer

plotly::sublot not showing both titles

I am trying to plot two plotly plots together in R using plotly::subplot. The problem is subplot doesn't show the titles of both the plots. Other answers to similar questions recommend either using facet_wrap or plot_ly, but I am looking for a…
Ed_Gravy
  • 1,841
  • 2
  • 11
  • 34
2
votes
1 answer

Facet_Wrap title overlapping with y-axis in ggplotly?

I am currently using a facet_wrap to knit data (html) to an Rmarkdown document. I am looking to use facet_wrap and ggplot to show this data. This is how the data looks just in ggplot (not plotly): However, when I use plotly the titles of each plot…
Jaskeil
  • 1,044
  • 12
  • 33
2
votes
1 answer

Hiding plotly tooltip color traces

Is there anyway to hide the tooltip color traces on a ggplot chart which has been made interactive w/ plotly? In the example below I would like my tooltip to go from this: To this: library(plotly) library(tidyverse) ## fake data dat <-…
DJC
  • 1,491
  • 6
  • 19
2
votes
0 answers

Names in diagonal in ggpairs (R)

I've been searching everywhere on how to replace the diagonal in this correlation plot matrix with the names of my variables... Is there anyway to do so? contVar <- c("survived", "age", "sibsp", "parch") ggpairs(na.omit(titanic)[, contVar], diag =…
mas2
  • 75
  • 11
2
votes
2 answers

When using ggplotly with facet_wrap, only the data of the first facet appears

I am plotting boxplots for multiple groups using ggplot() + geom_boxplot() + facet_wrap(). I would like to use ggplotly() on this object to use the hover tooltips so that I can quickly review data associated with the outliers. (Why am I not just…
nefosl
  • 366
  • 1
  • 8
2
votes
2 answers

Add an interactive button to switch which variable is mapped to fill in ggplotly in r

Using the same set of data, I have produced two different tile plots as shown below: DATA: > dput(coupler.graph) structure(list(Category = c("HBC", "TC", "BSC", "GSC", "GSC", "SSC", "SSC", "GSC", "GSC", "SSC", "SSC", "SSC", "HBC", "TC", "BSC",…
Maral Dorri
  • 468
  • 5
  • 17