plotly

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

馋奶兔 提交于 2020-12-30 02:35:27
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

北战南征 提交于 2020-12-30 02:33:06
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

Plotly: How to style a plotly figure so that it doesn't display gaps for missing dates?

半世苍凉 提交于 2020-12-23 02:42:48
问题 I have a plotly graph of the EUR/JPY exchange rate across a few months in 15 minute time intervals, so as a result, there is no data from friday evenings to sunday evenings. Here is a portion of the data, note the skip in the index (type: DatetimeIndex) over the weekend: Plotting this data in plotly results in a gap over the missing dates Using the dataframe above: import plotly.graph_objs as go candlesticks = go.Candlestick(x=data.index, open=data['Open'], high=data['High'], low=data['Low'],

Displaying Plotly histogram time in hh:mm:ss

左心房为你撑大大i 提交于 2020-12-16 07:44:33
问题 I have a vector of marathon finishing times I want to plot as a histogram with the x-axis/bins in hours and minutes hh:mm:ss format using the plot_ly function in R. library(plotly) R<-c("02:17:20", "02:17:26", "02:19:17", "02:19:18", "02:20:50", "02:21:20") plot_ly(x = as.difftime(R), type = "histogram") The x-axis and the popup on the chart displays in decimal format i.e 2.325 instead of 2:19:30 I assume this is because I'm using the difftime class. Is it possible to change the formatting of

Displaying Plotly histogram time in hh:mm:ss

心已入冬 提交于 2020-12-16 07:42:30
问题 I have a vector of marathon finishing times I want to plot as a histogram with the x-axis/bins in hours and minutes hh:mm:ss format using the plot_ly function in R. library(plotly) R<-c("02:17:20", "02:17:26", "02:19:17", "02:19:18", "02:20:50", "02:21:20") plot_ly(x = as.difftime(R), type = "histogram") The x-axis and the popup on the chart displays in decimal format i.e 2.325 instead of 2:19:30 I assume this is because I'm using the difftime class. Is it possible to change the formatting of

Open Plotly Express Graphs offiline

不打扰是莪最后的温柔 提交于 2020-12-15 06:52:20
问题 I was trying the Plotly doc first example but my web page that opens automatically on running the below scatter points code just doesn't open. It keeps loading and loading. import plotly.express as px fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16]) fig.show() How can I plot this graph offline like saving it as a file on my PC. Thank You 来源: https://stackoverflow.com/questions/65166468/open-plotly-express-graphs-offiline

Open Plotly Express Graphs offiline

▼魔方 西西 提交于 2020-12-15 06:50:29
问题 I was trying the Plotly doc first example but my web page that opens automatically on running the below scatter points code just doesn't open. It keeps loading and loading. import plotly.express as px fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16]) fig.show() How can I plot this graph offline like saving it as a file on my PC. Thank You 来源: https://stackoverflow.com/questions/65166468/open-plotly-express-graphs-offiline

Plot multiple time-series lines in 3D with ggplot/plotly

限于喜欢 提交于 2020-12-15 04:56:33
问题 I have a data frame containing different time-series signals which I'm trying to plot in 3D, with the x-axis representing Time, the Y-axis representing a standardized value for all the lines, and the Z-axis showing each line. Here's an example of what I mean. I have a snippet of code I'm trying to configure now to output it properly but I'm not sure how to properly assign the y and z variables. The df contains 5 columns; Time + 4 different time-series signals. plot_ly( data = df, x = df$Time,

Legend for multi surface plot with specific colors

狂风中的少年 提交于 2020-12-13 07:12:35
问题 Take the example for plot_ly function: library("plotly") z <- c( c(8.83,8.89,8.81,8.87,8.9,8.87), c(8.89,8.94,8.85,8.94,8.96,8.92), c(8.84,8.9,8.82,8.92,8.93,8.91), c(8.79,8.85,8.79,8.9,8.94,8.92), c(8.79,8.88,8.81,8.9,8.95,8.92), c(8.8,8.82,8.78,8.91,8.94,8.92), c(8.75,8.78,8.77,8.91,8.95,8.92), c(8.8,8.8,8.77,8.91,8.95,8.94), c(8.74,8.81,8.76,8.93,8.98,8.99), c(8.89,8.99,8.92,9.1,9.13,9.11), c(8.97,8.97,8.91,9.09,9.11,9.11), c(9.04,9.08,9.05,9.25,9.28,9.27), c(9,9.01,9,9.2,9.23,9.2), c(8.99

Plotly: How to set up multiple subplots with grouped legends?

旧街凉风 提交于 2020-12-13 05:44:28
问题 for each subplot I have 3 seperate line:2017 ,2018 and 2019 with 3 times "go.Scatter", each subplot represents one country (25 countries) with always these 3 years. I can use the subplot sample code but then all the 75 legends (25 X 3) will be all together with different colors and it's messy. I don't need different colors amont different subplot, I can just have 3 different colors and 3 legends for the 3 years on all subplots, would be ideal if I click on for example 2017 that all the 2017