plotly

Interactively change axis scale (linear/log) in Plotly image using R

冷暖自知 提交于 2021-02-18 17:09:38
问题 Goal: To create interactive dropdown/buttons to update the axes' scale for a Plotly figure from R. Issue: There is a lot of documentation on creating buttons and log plots using layout and updatemenus ; however, it was difficult to find one that described how a button could be added specifically for changing the scale of the axes. Some posts on stackoverflow provided solutions for doing this in python but I struggled to find an equivalent one for R. I have provided a solution/example here

How can I send a plot.ly image inline of an html email using smtp?

你。 提交于 2021-02-18 12:51:47
问题 I'm automating a couple of bi-weekly reports so I've decided to use plot.ly to create a line plot. This line plot has a varying amount of traces depending on the report that is being run. I've been able to create plots successfully but none of the methods I've found have worked for displaying the plot inline in my email. Here is my code: SMTP_SERVER = "smtp.office365.com" SMTP_PORT = 587 SMTP_USERNAME = username SMTP_PASSWORD = password EMAIL_TO = email_to EMAIL_FROM = email_from #here we

How can I send a plot.ly image inline of an html email using smtp?

99封情书 提交于 2021-02-18 12:51:31
问题 I'm automating a couple of bi-weekly reports so I've decided to use plot.ly to create a line plot. This line plot has a varying amount of traces depending on the report that is being run. I've been able to create plots successfully but none of the methods I've found have worked for displaying the plot inline in my email. Here is my code: SMTP_SERVER = "smtp.office365.com" SMTP_PORT = 587 SMTP_USERNAME = username SMTP_PASSWORD = password EMAIL_TO = email_to EMAIL_FROM = email_from #here we

How to use Plotly with Zeppelin

主宰稳场 提交于 2021-02-18 00:53:51
问题 I've seen zeppelin-plotly but it seems too complicated. The other things that worries me is that it involves modifying zeppelin's .war file and I don't want to break things by error. Is there another way to use Plotly with Zeppelin? 回答1: Figured it out using the %angular interpreter feature. Here are the full steps to get it working 1: Install plotly (if you haven't) %sh pip install plotly You can also do this on the terminal if you have access to it 2: Define a plot function def plot(plot

R: Titles on Graphs not Updating

自作多情 提交于 2021-02-17 06:53:26
问题 I am working with the R programming language. I am trying to replicate the following tutorial with some fake data that I generated: https://plotly.com/r/dropdowns/. That is, I generated some fake data and made 4 scatter plots. Using the "plotly" library, I then want to "attach" these 4 plots together and let the user "toggle" (switch, shuffle) between these graphs. I have attached the code below: #load libraries library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1

NodeJS Plotly - how to wait for getImage to finish before continuing

Deadly 提交于 2021-02-16 15:27:26
问题 So, what I am trying to accomplish is basically: Generating a plot by using NodeJS and plotly for NodeJS and getting it into my filesystem (with getImage ), and proceeding with the image afterwards. My problem is, that the function returns before finishing and getting the image into my filesystem. So my result is basically that after I'm calling generate_plot() , the file does not exist yet and I'm getting an error. Now onto my question: How do I wait for generate_plot() to finish and to

Adding Multiple “sliders” to the same Graph

你。 提交于 2021-02-16 15:25:31
问题 I am using the R programming language. Using the "plotly" library, I was able to make the following interactive graph: library(dplyr) library(ggplot2) library(shiny) library(plotly) library(htmltools) library(dplyr) #generate data set.seed(123) var = rnorm(731, 100,25) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") data = data.frame(var,date) vals <- 90:100 combine <- vector('list', length(vals)) count <- 0 for (i in vals) { data$var_i = i data$new_var_i = ifelse(data$var >i,1,0

Plotly contour subplots each having their own colorbar

隐身守侯 提交于 2021-02-16 15:21:31
问题 I am trying to generate contours using Plotly. There are 5 contours which I am plotting in a 5x1 grid using subplots. I am unable to see an option by which I can have a separate colorbar for each contour subplot. For line plots I can use shared_xaxes or shared_yaxes options, but unable to find documentation where I can have a separate colorbar for each subplot in this 5x1 grid. Here are some reference links I tried to go through: https://plot.ly/python/contour-plots/ https://plot.ly/python

Plotly (Python) Subplots: Padding Facets and Sharing Legends

本小妞迷上赌 提交于 2021-02-16 14:58:48
问题 I'm trying to create 2 plots with a shared x-axis and I'm having 2 problems with this: As soon as I customise the layout with yaxis and yaxis2 titles and/or tickmarks, y-axes begin to overlap I would like the legends to be shared between the 2 plots, but instead they are duplicated Here is the code to reproduce the problem I'm experiencing: from plotly.offline import init_notebook_mode, iplot init_notebook_mode(connected=True) # using jupyter import plotly.graph_objs as go from plotly import

Plotly (Python) Subplots: Padding Facets and Sharing Legends

廉价感情. 提交于 2021-02-16 14:58:28
问题 I'm trying to create 2 plots with a shared x-axis and I'm having 2 problems with this: As soon as I customise the layout with yaxis and yaxis2 titles and/or tickmarks, y-axes begin to overlap I would like the legends to be shared between the 2 plots, but instead they are duplicated Here is the code to reproduce the problem I'm experiencing: from plotly.offline import init_notebook_mode, iplot init_notebook_mode(connected=True) # using jupyter import plotly.graph_objs as go from plotly import