Questions tagged [r-plotly]

plotly is an R package to create interactive web-based visualizations via 'plotly.js'.

plotly is a plotting package for R used to create interactive data visualizations. For examples and documentation, visit the plotly website here.

Repository

Stable Version on Cran

1205 questions
6
votes
3 answers

Selecting a default value in an R plotly plot using a selectize box via crosstalk in R, using static html not shiny

In an Rmarkdown html document, how does one select a default value for a crosstalk::filter_select dropdown that will work with plotly plots? E.g., in the example below, to have just group 'a' selected when the RMD is knitted. I know that for the…
FelixST
  • 303
  • 2
  • 8
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
6
votes
1 answer

Zoom on y-axis while using plotly::rangeslider

I would like to zoom in on the y-axis on a plotly plot that uses rangeslider. A reproducible example: library(ggplot2) library(plotly) p <- ggplot(faithful, aes(x = waiting)) + geom_histogram(bins = 30) p <- ggplotly(p) p <-…
NiklasvMoers
  • 309
  • 2
  • 13
6
votes
0 answers

plots not showing in flexdashboard tabs

When I render the flexdashboard the plotly chart only shows on the first tab, and not on the remaining tabs. The reproducible example below uses the flexdashboard example for .tabset use. I am running R 3.6.1 I have used plotly and tabset in the…
6
votes
0 answers

Animated plotly gauge plot with changing colors and text annotation

I have a gauge plot I want to animate (following this tutorial), with the color of the plot changing according to the current value. I also want an annotation* which displays the current value of the gauge (I don't want the standard value displayed…
Wasabi
  • 2,879
  • 3
  • 26
  • 48
6
votes
1 answer

Renderplotly does not work despite not having any errors

I'm using renderPlotly for my ggplot graph in shiny. when I run the app no errors are shown but no plots are rendered as well. Is there a problem with my code? Here's an example of my data set year region mean_price
Elliot Tan
  • 149
  • 4
  • 11
6
votes
1 answer

Overlay a grouped bar chart with scatter in plotly

I'm trying to superimpose a scatter on top of a grouped bar chart in plotly. However, whereas in a simple bar chart the scatter points are correctly placed at the top of the respective bars, in a grouped bar chart the scatter points do not…
bobbel
  • 1,983
  • 6
  • 21
6
votes
1 answer

The ggplotly() ignores legend labels editing despite using scale_fill_manual()

I use the data frame below: Name <- c("DCH", "DCH", "DCH", "DGI", "DGI", "DGI", "LDP", "LDP", "LDP", "RH", "RH", "RH", "TC", "TC", "TC") Class <- c("Class1", "Class2", "Overlap", "Class1", "Class2", "Overlap", "Class1", "Class2", "Overlap",…
firmo23
  • 7,490
  • 2
  • 38
  • 114
6
votes
2 answers

R. plotly - padding or margin for graph inside Shinyapp?

I've a plotly plot that has not right left margin (neither at the bottom). Cannot find the documentation to add this extra space so my y axis (this plot is in horinzontal mode) don't get cut. ui.R: tabItem(tabName = "ga", …
Omar Gonzales
  • 3,806
  • 10
  • 56
  • 120
6
votes
1 answer

add_trace: control the color

I have a plot where I have first trace in gray that will be overplotted by other traces in colors. My issue is that in plotly-version 4.7.1. as well as in version 4.8.0. I can't adjust the color. One year ago this code would work:…
5th
  • 2,097
  • 3
  • 22
  • 41
6
votes
1 answer

Is there a way to hide Trace Names in Plotly (specifically R)?

I've been wracking my brain over how to get rid of the trace name with plotly and can't seem to find anything. It seems adding the trace name is a unique feature of plotly boxplots. I could just name it " " but I need the original trace name so that…
robotvsbears
  • 63
  • 1
  • 3
6
votes
1 answer

R: Change font size in plot_ly

I've been trying to change the size of the labels on my x and y axes of a graph drawn using plot_ly in R. Below is my code: q <- plot_ly( x=colnames(avg_exp_norm), y=row.names(avg_exp_norm), z = avg_exp_norm, type = "heatmap") %>% …
Sadegh Davoudi
  • 95
  • 1
  • 1
  • 6
6
votes
2 answers

Is there any other way to implement plotly R’s cumulative animation?

accumulate_by <- function(dat, var) { var <- lazyeval::f_eval(var, dat) lvls <- plotly:::getLevels(var) dats <- lapply(seq_along(lvls), function(x) { cbind(dat[var %in% lvls[seq(1, x)], ], frame = lvls[[x]]) }) …
Ungurrer
  • 111
  • 5
6
votes
1 answer

Showing all plot titles in plotly::subplot

I have two density plots created by R's plotly: set.seed(1) dens.1 <- density(runif(1000,0,100)) dens.2 <- density(runif(1000,100,10000)) df.1 <- data.frame(x=dens.1$x,y=dens.1$y) df.2 <- data.frame(x=dens.2$x,y=dens.2$y) library(plotly) pl.1 <-…
dan
  • 6,048
  • 10
  • 57
  • 125
6
votes
2 answers

How to make a custom hoverinfo lables for Plotly boxplot?

Basically I have a problem with the current version of Plotly which doesn't display hoverinfo for box plot correctly. It omits labels (min, max, median etc.), so when I plot the following plot: plot_ly(y = ~rnorm(50), type = "box") I don't have…
magasr
  • 493
  • 5
  • 21