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

Remove outliers from a ggplotly() boxplot

I have the dataframe below: etf_id<-c("a","b","c","d","e","a","b","c","d","e","a","b","c","d","e") factor<-c("A","A","A","A","A","B","B","B","B","B","C","C","C","C","C") normalized<-c(-0.048436801,2.850578601,2.551666490,0.928625186,-0.638111793, …
firmo23
  • 7,490
  • 2
  • 38
  • 114
2
votes
1 answer

R ggplotly shows wrong tooltip with geom_sf() and discrete fill scale

I'm trying to create maps that'll show tooltips on hover with plotly. In the maps below, I've tried to make it show the name and the area of each place. The first map, which has a continuous fill scale, shows the tooltip I'm asking for. But the…
Oliver
  • 1,098
  • 1
  • 11
  • 16
2
votes
1 answer

Slider for Plotly R

I have plotted two following graphs using ggplot2, using the following codes. p <- ggplot() + geom_line(data = campaigns_profit_3months, aes(y = clients_3monthsBefore, x = c(1:41), group = 1, color = "Clients 3 Months Before"), size =…
2
votes
1 answer

R: Legend not showing in ggplotly map

I have made a map with ggplot which shows points on the map with different sizes based on the Freq value in my dataframe: Longitude Latitude Result Freq 4.690000 51.97400 Neg 1 6.040604 51.66494 Neg 23 6.87448 …
Kak Schoen
  • 364
  • 2
  • 18
2
votes
1 answer

ggplotly with geom_bar shows wrong y-axis values when moving the cursor onto the bar

I have the following code creating a bar plot: require(data.table) require(plotly) require(ggplot2) df1 <- data.table(Time = seq(50, 290, 30), Enter = c(155000, 400000, 950000, 950000, 1000000, 1100000, 1100000, 1100000, 1150000), Exit = c(150000,…
sh_student
  • 369
  • 2
  • 14
2
votes
0 answers

Manually set the hoverinfo text

I have the dataframe below which I process properly in order to create a cluster scatter plot with: library(tidyverse) # data manipulation library(cluster) # clustering algorithms library(factoextra) # clustering algorithms &…
firmo23
  • 7,490
  • 2
  • 38
  • 114
2
votes
1 answer

How to display separate error bars in box plot R?

Apologies in advance, this is my first time posting on SO. I'm trying to create box plots for a series of data. Using a method I learned on SO, I melted the data such that it appears this way: > head(d.m.ea) group variable value 465 Test …
2
votes
1 answer

In ggplotly, how can deselect legend entries with code?

I am making a ggplotly plot that defines groups with different fill colors (group A or Group B). library(ggplot2) library(plotly) data <- data.frame(x = c(1,2,3, 10, 11, 12), y = c(1,2,3, 10, 11, 12), group…
itsMeInMiami
  • 2,324
  • 1
  • 13
  • 34
2
votes
2 answers

Using ggplotly rangeslider for interactive relative performance (stock returns)

I am trying to make an interactive stock performance plot from R. It is to compare the relative performance of several stocks. Each stock's performance line should start at 0%. For static plots I would use dplyr group_by and mutate to calculate…
Martin
  • 1,141
  • 14
  • 24
2
votes
1 answer

Plotly hovering on tiles in the background of a cloud of points - how to show the tooltip?

I'm converting a ggplot2 plot to plotly. The plot consists of a tile layer (in the background) and a point layer (in the foreground). I would like to have tooltips when hovering on the tiles. The code below mostly gets me what I am looking for.…
Max
  • 85
  • 1
  • 7
2
votes
1 answer

How to fix the hoverinfo error in my shiny app?

I have developed a shiny app using ggplot2 and plotly, however, the hover text was not correctly showed for two horizontal lines which I added as the upper and lower limits. I want to hide the hover text for these two lines. Does anyone know how to…
clarkchen
  • 21
  • 2
2
votes
2 answers

R Plotly Disable Legend Click and Legend Double Click

I would like to disable the plotly legend selection from the server side using the R Plotly. We see here that it is possible to achieve this on plotly javascript using the following, gd.on('plotly_legendclick',function() { return false; }) Is there…
Sada93
  • 2,785
  • 1
  • 10
  • 21
2
votes
0 answers

Customizing the tooltip orientation and alignment in ggplotly

I try to customize the orientation and text alignment of a tooltip in a plotly-graphic generated using ggplot and ggplotly. However, I am not able to achieve this and would be glad if somebody could help me. Goal is to have a tooltip on top of the…
david_zrh
  • 23
  • 4
2
votes
1 answer

Manipulating height attribute of renderPlotly object?

I want to include multiple plots of varying heights within a single shiny dashboard tab. Many existing answers cover setting the height parameter in ggplotly. Using this parameter does change how a figure will render. But, it doesn't fix my problem.…
akorn
  • 70
  • 6
2
votes
1 answer

Lay a region over all USA map in R

I want to plot a map of the following data, dt_plot, which has 2 unique counties in it. fr long lat group order region subregion polyname 10 -121.031609 48.3060722 2894 85063 washington chelan …
OverFlow Police
  • 861
  • 6
  • 23