plotly

Change plotly chart y variable based on selectInput

孤者浪人 提交于 2020-02-26 09:09:43
问题 I'm creating a simple line chart which renders correctly in Shiny. I've now added a selectInput with the names of 2 different measures, written as they appear in my data set. I'd like my y variable to change accordingly. p <- plot_ly(data = LineChartData(), x= Calendar.Month, y = input$Measure, type = "line", group = Calendar.Year, col = Calendar.Year) Unfortunately, the chart renders with just one point. It's not taking input$Measure and finding that field in my data set. I know when using

Plotly flips ggplot2 boxplot

◇◆丶佛笑我妖孽 提交于 2020-02-25 06:11:15
问题 I want to plot boxplot using only summary statistics ( INPUT is summary statistics for each ID ). plot1 is what I want, but when I convert it to a plotly object something goes wrong (ie., plotly flips boxplot ). However, if I plot boxplot the usual way (not using stat = "identity" ) everything works fine. Question: Why plotly "flips" summarised ggplot2 boxplot and how to avoid this? library(broom) library(plotly) library(tidyverse) # Generate random data # Calculate statistics INPUT <- rnorm

Plotly flips ggplot2 boxplot

孤街浪徒 提交于 2020-02-25 06:10:35
问题 I want to plot boxplot using only summary statistics ( INPUT is summary statistics for each ID ). plot1 is what I want, but when I convert it to a plotly object something goes wrong (ie., plotly flips boxplot ). However, if I plot boxplot the usual way (not using stat = "identity" ) everything works fine. Question: Why plotly "flips" summarised ggplot2 boxplot and how to avoid this? library(broom) library(plotly) library(tidyverse) # Generate random data # Calculate statistics INPUT <- rnorm

Plotly Plot surface 3D not displayed

萝らか妹 提交于 2020-02-24 09:27:05
问题 I really can't find an answer on the forum. I want to create a 3d surface with plotly offline. I use sample points. The scene displays empty without a surface. Please help, thanks. import pandas as pd import numpy as np from plotly.offline import download_plotlyjs, init_notebook_mode, plot from plotly.graph_objs import * init_notebook_mode() df3=pd.DataFrame({'x':[1,2,3,4,5], 'y':[10,20,30,20,10], 'z':[5,4,3,2,1]}) trace0= Surface(x=df3['x'], y=df3['y'], z=df3['z']) data=[trace0] fig=dict

ggplotly text aesthetic causing geom_line to not display

喜你入骨 提交于 2020-02-23 09:02:48
问题 I'm trying to render a simple geom_line with a tooltip defined by a text aesthetic. q <- ggplot(data = graphDataFactor(), aes(x = Dates, y=Variable_Data, colour = Variable_Name #, #text = paste('Date: ', as.Date(Dates), #'<br>Variable:', Variable_Name, #'<br>Var Unit:', Variable_Data #) )) + geom_line(size = 1) + labs(colour = "Variables") ggplotly(q #, tooltip = c("text") ) So this code with the text aesthetic commented out works fine and renders the line. However, when I try to use the text

Plotly.js modebar, download as png, give png a name

安稳与你 提交于 2020-02-05 03:23:17
问题 I have a Plotly on my webpage and you can download it as a png by clicking the picture icon in the modebar. However when I click it, it downloads it as a png with the name new-plot, how can I give it a custom name? My current code (var data is just data, so left it out) : var layout = { showlegend: true, legend: { x: 0, y: 1 }, xaxis: { title: 'Date', titlefont: { family: 'Courier New, monospace', size: 18, color: '#7f7f7f' } }, yaxis: { title: 'Sales', titlefont: { family: 'Courier New,

Using plotly with zeppellin in scala

≯℡__Kan透↙ 提交于 2020-02-04 02:14:05
问题 I want to display my results in the form of a histogram in Zeppelin. I came across plotly. My code is in scala and I would like to know the steps to incorporate plotly into zeppelin using scala. Or is there any better way(libraries) that can be used to draw a histogram in Zeppelin(Scala)? 回答1: If you have a dataframe called plotTemp with columns "id","degree" then you can do the following: In a scala window register the dataframe as a temporary table plotTemp.registerTempTable("plotTemp")

Plotting Different Groups with Plotly

╄→гoц情女王★ 提交于 2020-02-03 18:57:30
问题 I have a dataframe in python that looks a bit like this: Device Date Reading Device1 1/02/17 100.33 Device1 2/02/17 300.23 Device1 3/02/17 99.00 Device2 1/02/17 11.24 Device2 2/02/17 654.00 Device2 3/02/17 4543.4 Device3 1/02/17 3243.5 Device3 2/02/17 545.43 Device3 3/02/17 4545.0 It basically has devices, dates and a reading. It's much larger than the snippet I've given. I am trying to plot, preferably using plotly because it is is interactive and allows me to zoom, etc, which is ideal for

Plotting Different Groups with Plotly

二次信任 提交于 2020-02-03 18:55:33
问题 I have a dataframe in python that looks a bit like this: Device Date Reading Device1 1/02/17 100.33 Device1 2/02/17 300.23 Device1 3/02/17 99.00 Device2 1/02/17 11.24 Device2 2/02/17 654.00 Device2 3/02/17 4543.4 Device3 1/02/17 3243.5 Device3 2/02/17 545.43 Device3 3/02/17 4545.0 It basically has devices, dates and a reading. It's much larger than the snippet I've given. I am trying to plot, preferably using plotly because it is is interactive and allows me to zoom, etc, which is ideal for

Plotting Different Groups with Plotly

十年热恋 提交于 2020-02-03 18:54:50
问题 I have a dataframe in python that looks a bit like this: Device Date Reading Device1 1/02/17 100.33 Device1 2/02/17 300.23 Device1 3/02/17 99.00 Device2 1/02/17 11.24 Device2 2/02/17 654.00 Device2 3/02/17 4543.4 Device3 1/02/17 3243.5 Device3 2/02/17 545.43 Device3 3/02/17 4545.0 It basically has devices, dates and a reading. It's much larger than the snippet I've given. I am trying to plot, preferably using plotly because it is is interactive and allows me to zoom, etc, which is ideal for