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

error when displaying more details in plotly tooltip

Im trying to display more data on hoover over a point, than default point coordinates. It works when I display only one extra information for example: output$myplot <- renderPlotly({ if (is.null(filtered())) { return() } …
Alex T
  • 3,529
  • 12
  • 56
  • 105
0
votes
1 answer

Show two bar plots with geom points and single legend using subplots in r

I want to show two bar plots with geom points on it using subplots. my code - df_1 <- iris[,c("Species", "Petal.Length","Petal.Width")] df_2 <- iris[,c("Species", "Sepal.Length","Sepal.Width")] df_1["Condition_1"] <- "P…
0
votes
1 answer

Converting a ggplot/manipulate plot to a plotly or a js-scripted plot

I'm trying to convert my ggplot to a plotly plot using ggplotly(). However, it doesn't seem to work on this code, after manipulate is acted on the plot. Is there any other way to do it? library(ggplot2) library(manipulate) grades <- data.frame(Final…
0
votes
0 answers

2D kernel density plot with 3d version in R Plotly

My dataset looks like this:dataset I adopted code here: 2d kernel density plot kd <- with(test, MASS::kde2d(x=`Avg Protein`,y=`Avg Oil Content`,n=100)) p <- plot_ly(x = kd$x, y = kd$y, z = kd$z) %>% add_surface() p while, my result is not…
Mia
  • 31
  • 6
0
votes
0 answers

R: ggplot, plotly and auto-adjust of a Stacked bar plot

I'm facing this problem with ggplot2 and plotly packages with R. I'm creating a stacked bar chart, and, first of all, my data: # here my data family <- c('one','one','one','one','one','one','one','one', …
s__
  • 9,270
  • 3
  • 27
  • 45
0
votes
1 answer

number instead of date on the density plot in R

I have a problem. I am trying to draw a density plot in R with the plotly package. But when I hover the mouse over the plot I get number format of date 17623 instead 2018-04-02. Any ideas how to solve this problem? Date <-…
tomsu
  • 371
  • 2
  • 16
0
votes
0 answers

showing saved HTML plots in Shiny

I have a lot of plots saved in a folder and their format is *.html so they could be easily viewed in a browser. Plots were made using plotly in R. I want to build a Shiny app to view these saved files. Does anyone know how to read and view these…
Phil sh
  • 41
  • 2
0
votes
1 answer

Conflict between DT and Plotly to show NA in table

There is a solution to show NA or Inf values in a table created with DT using options(htmlwidgets.TOJSON_ARGS = list(na = 'string')) as described here. The problem is that htmlwidgets.TOJSON_ARGS is also affecting plotly. Below is simple example of…
Geovany
  • 5,389
  • 21
  • 37
0
votes
1 answer

ggplot : Hide geom_ribbon by default to my plot

I have this plot : g.mean <- ggplot(df,aes(x = as.numeric(xx),y=yy,color=varc)) + geom_line() + geom_ribbon(aes(ymin=Born_Inf, ymax=Born_Sup, fill=varc), alpha=0.1) Is there a way to hide only geom_ribbon() and print geom_line() to my…
Cox Tox
  • 661
  • 3
  • 8
  • 22
0
votes
1 answer

Having problems graphing a plotly line chart instead of scatter

I have created a shiny application that has a drop down to select items. The current code looks like this: #Import libraries library(shiny) library(plotly) library(tidyr) # Define UI ui <- bootstrapPage( selectInput(inputId = "n_breaks", …
sectechguy
  • 2,037
  • 4
  • 28
  • 61
0
votes
0 answers

how to get data from selected portion of pie in plotly

please have a look I want to get the data from a selected portion of pie suppose i select the blue portion as in figure so i get the data from that portion i.e. February shinyServer(function(input, output, session) { usvltdyearstore1 =…
Rohit Jha
  • 11
  • 5
0
votes
0 answers

Plotly raster images

I am trying to plot raster images on plotly, and using this very helpful book as a reference. Here's the code that has been used to produce the image in the link - m <- matrix(hcl(0, 80, seq(50, 80, 10)), nrow = 4, ncol = 5) r <-…
Ameya
  • 1,712
  • 1
  • 14
  • 29
0
votes
0 answers

Plotly Scatter Plot: Symbol disrupts the colorscale and categorical x-y positions

I'm creating a unique type of categorical scatter plot with plotly in R, where: color is indicated by a continuous numeric variable size is indicated by a continuous numeric symbol is indicated by a categorical both axis are categorical…
0
votes
1 answer

Get axis ranges after plotly resize in Shiny

I have a Shiny app with a Plotly plot of time-series data. I want the user to be able to pan the x (time) axis, but keeping a consistent window of one day. To do this, I need to get the current x-axis range after each resize. Why am I not just using…
thisislammers
  • 424
  • 3
  • 13
0
votes
1 answer

How to have bar labels be names in Plotly for R

So I'm trying to make a bar chart that displays the most popular airports that flew to Chicago. For some reason, I'm finding it to be extremely difficult to have my bars be labeled by the airport names specifically. I have a data frame called ty >…