plotly

same code for function plot_ly in R gives different results in a project and in RGui: Error in Layout, unused arguments

爱⌒轻易说出口 提交于 2019-12-25 00:48:00
问题 I'm launching a simple function inside a project in RStudio for R3.4.0 for Windows 10. #' TestPlotly #' @export #' @importFrom plotly plot_ly #' @importFrom graphics layout #' @importFrom magrittr "%>%" TestPlotly=function() { plot_ly(x = 1:10, y = 1:10,type="scatter",mode="lines") %>% layout( xaxis = list(title="tr"), yaxis = list(title="ts") ) } I get: Error in layout(., xaxis = list(title = "tr"), yaxis = list(title = "ts")) : unused arguments (xaxis = list(title = "tr"), yaxis = list

Ploting box plot from statistical summary data

巧了我就是萌 提交于 2019-12-25 00:29:39
问题 I would like to add a box plot to my page. Something like this (using Plotly.js). The problem with implementing the example from the link above is that the plotly.js library expect all the points, whereas I only have access to the already computed statistical data. In other words, I would like to plot the graphic by passing max , min , med , avr , stdev (statistical data of the series) instead of all the data points themselves. P.s.: Using plotly.js is not a requirement. I could go with D3.js

Plotly error: Invalid 'figure_or_data' argument

两盒软妹~` 提交于 2019-12-24 21:21:21
问题 an animation example from this plotly tutorial is not working with Plotly 2.0.12. I put the error output below. Is there any way to solve the problem? I am using plotly on a Jupyter Notebook. PlotlyError: Invalid 'figure_or_data' argument. Plotly will not be able to properly parse the resulting JSON. If you want to send this 'figure_or_data' to Plotly anyway (not recommended), you can set 'validate=False' as a plot option. Here's why you're seeing this error: 'slider' is not allowed in

Updating candlestick data point using restyle in Plotly.js

£可爱£侵袭症+ 提交于 2019-12-24 21:06:24
问题 I am using a WebSocket connection to update a candlestick chart with live data. Creating the initial candlestick chart is relatively easy: var candleDiv = document.getElementById('candle-chart'); var data = { x: x, //Each of these is a single dimension array of the same length open: open, close: close, high: high, low: low, type: 'candlestick', }; var layout = { datarevision: candleCount, dragmode: 'zoom', showlegend: false, xaxis: { type: 'date', range: [x[x.length - 26], x[x.length - 1]], /

Dial Position Gauge Chart Plotly R

浪子不回头ぞ 提交于 2019-12-24 20:15:47
问题 This question appears to have been asked a couple of times in one fashion or another, but I can't quite seem to find the correct answer. I'm trying to move the center dial on a plotly gauge chart. I'm using the demo that has been provided (https://plot.ly/r/gauge-charts/), and I'm also using guidance from this post (How to rotate the dial in a gauge chart? Using python plotly) - although it's python and not r . I have absolutely zero experience with SVG- as I'm sure you can tell. Any help

R Plotly Polar Equation Rose Curve Graph Issue

匆匆过客 提交于 2019-12-24 19:33:10
问题 I am trying to graph polar equations in R using plotly. However, when I graph a rose curve, I'm not getting the right amount of petals in the graph. My code... library(plotly) f <- function(){ output <- matrix(ncol=2, nrow = 361) for (i in 0:360){ output[i,1] <- i output[i,2] <- 3 * cos(2 * (i * pi/180)) } return(output) } mf <- f() df <- data.frame("theta" = mf[,1], "r"=mf[,2]) p <- plot_ly( df, type = 'scatterpolar', mode = 'lines' ) %>% add_trace( r = ~r, theta = ~theta, name = 'Function',

Custom hover effects for each point in plotly boxplot with markers in R

跟風遠走 提交于 2019-12-24 19:28:20
问题 The following link - https://plot.ly/r/box-plots/#basic-boxplot - leads to the main tutorial that plotly offers for boxplots in R, and the specific plot type that I am interested in working with is the following: p <- plot_ly(y = ~rnorm(50), type = "box", boxpoints = "all", jitter = 0.3, pointpos = -1.8) In particular, I would like to play around with the hovertext on these plots, so that I am able to hover over each point individually. For anybody familiar with plotly, is this possible with

Plotly map: inverse colorscale tick values

烈酒焚心 提交于 2019-12-24 14:34:33
问题 In Plotly maps (Python), how can I inverse the tick labels on the colorscale so that the smallest value is at the top and the largest at the bottom? For example, -100 at the top and 100 at the bottom? Note: I do not want to change the colors, just the associated tick values. 回答1: You can do it with the ticktext input In your colorbar definition, include tickmode="array" along with ticktext= and tickvals= Something like this: colorbar=dict(tickmode="array",ticktext=[100,-100],tickvals=[-100

Reasons event_data() does not register full range of surface when first dimension < second dimension

邮差的信 提交于 2019-12-24 11:34:11
问题 Consider the following examples of a 3D surface plot produced with plotly and shiny. library(shiny) library(plotly) # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("plotly_event problems"), # Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel( selectInput("vis_type", "Select type of visualisation", choices = c( "x and y the same (ok)" = "x_y_same", "x and y same step but diff length (ok)"= "x_y_same_step", "x and y

Saving or downloading plotly iplot images on Google Colaboratory

余生长醉 提交于 2019-12-24 10:48:39
问题 I have been attempting to download a plot created using plotly on google colaboratory. So far this is what I have attempted: I have tried changing files.download('foo.svg') to files.download('foo') and I still get no results. I navigated to the files on Google colab and nothing shows there import numpy as np import pandas as pd from plotly.offline import iplot import plotly.graph_objs as go from google.colab import files def enable_plotly_in_cell(): import IPython from plotly.offline import