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

Alternating x-values being plotted instead of full set for multiple time series - Shinydashboard using ggplotly

I've got my shiny app 99% complete but can't for the life of me figure out why when I add multiple series from the "Region" input selector to the chart in the first chart, the x values are change/skipped. When I have just one series (default =…
0
votes
2 answers

How do I add single points to a multi-line chart with ggplot in R?

I have a multi-line chart created using ggplot2 with autoplot and plotly in R code. I would like to add a single point on each line on the chart. The data frame I am plotting is of class xts. In the toy example below, I would like to add a point at…
Ernie
  • 1,103
  • 1
  • 14
  • 25
0
votes
1 answer

how to make my ggplotly tootip show the original value when axis log-transformed

I have a plotly histogram where x-axis is log tranformed. I'm trying to make my histogram tooltip show the original value rather than the log10-transformed value. I'm referring to this example. Overwriting the text attribute. Below is my code. …
zesla
  • 11,155
  • 16
  • 82
  • 147
0
votes
1 answer

Change variable names into variable labels and remove legend title

I created a function to produce ggplot choropleth maps, and it works :) However, I would like to remove the legend title (see picture below), since it now says 'I'. Furthermore, I would like to change the hover text into the variable labels as…
0
votes
1 answer

Select multiple points on the ggplot and draw line through them

Is there any way I can select some points on a plot generated by ggplot or ggplotly, and then these points get connected by lines. I want to use this in a shiny app that I am developing, in which, the app is generating a graph, and I want the user…
0
votes
1 answer

How to adapt plotly hovermode 'x' option to work with no additional aesthetics and at overlapping co-ordinates?

I'm trying to replicate the hovermode seen in this plotly example at 33.1: Where it gives you only the information of the specific x co-ordinate in the hover, but with multiple entries. In my real dataset, I do not set any additional aesthetics,…
Nautica
  • 2,004
  • 1
  • 12
  • 35
0
votes
1 answer

how to put two variables from a dataset on a bar graph stacked in R

I am trying to put two variables of a datatable in a bar chart (available and unavailable) in percentage (y axis) and Date in x axis for each service (color in the plotly to differentiate the services). This is my datatable with respective…
Liliana
  • 1
  • 2
0
votes
1 answer

ggplotly toolbar position within shiny app

Using the code below, I could create my ggplotly graph. As shown in the image below, the ggplotly toolbar overlap with the plot's title. How can I move the toolbar to the left side of the plot? Also, how can I add a space between the title and the…
Nader Mehri
  • 514
  • 1
  • 5
  • 21
0
votes
1 answer

How to rename many variables in ggplotly?

How to rename many variables in ggplotly? When I scroll over the interactive graphs, the names are not pleasant to look at. I want to format them to include spacing, etc.
purple_plop
  • 280
  • 1
  • 10
0
votes
0 answers

User interactive plots by ggplotly or plotly, Deleting datapoint on scatterplot generated by plotly or ggplotly

In my app user is uploading CSV file/s and graphs are generated by using this/these file/s. The uploaded data is rendered by using rendertable and these tables are used to render the plots using renderplot. I am able to render a ggplot or plotly…
0
votes
1 answer

ggplotly animation showing only animation not showing main graph line inside ShinyApp

I'm using ggplotly in a shinyApp. The application works fine with ggplotly for normal graphs. However, when I tried to add animation to the graph, the graph only showed movements of the points not the whole graph. The code is running without errors…
SimpleNEasy
  • 879
  • 3
  • 11
  • 32
0
votes
1 answer

How to show correct horizontal axis in ggplotly when it is a date

I'm pretty sure this is a bug, and am hoping in the short term for a workaround. library(tidyverse) library(plotly) d <- tibble( date = as.Date("2012-01-01") + 0:5000, y = rnorm(5001) ) p <- ggplot(d, aes (x = date, y = y)) + geom_point()…
Peter Ellis
  • 5,694
  • 30
  • 46
0
votes
1 answer

Plotly width larger than content

I'm using Plotly (ggplotly) in my rmarkdown file. The width of the plot is larger than the content, see attached screenshot. As you can see the legend is outside the content. Can I fix this using CSS, if so, how?
Viðar Ingason
  • 265
  • 3
  • 11
0
votes
1 answer

How to data wrangle and barplot the proportion without undesired stripes

Please find the input data and expected output as screenshot below: However, the current plot with the below code: I feel, I made it too complicated. But I shared input data and expected data along with struggled code along the way. Could you…
Abhishek
  • 407
  • 3
  • 18
0
votes
1 answer

How to add tooltips to geom_abline & geom_hline using ggplotly?

I have a dataset that looks like: ID <- paste("S",seq(1, 120, 1), sep="") Days <- round(rnorm(120, 100, 20), 0) Sales <- round(rnorm(120, 16, 10), 2) mult <-round(rnorm(120, 1.4, 0.4), 2) mult[mult<1] <-1 Items_Sold <- round(Sales*mult,…
Mel
  • 700
  • 6
  • 31