plotly

Plotly Value error - Invalid property for colour

心不动则不痛 提交于 2019-12-23 19:35:07
问题 I have been experiencing errors while generating charts using Plotly and it seems to be affecting most of the charts I try producing on it. The error also seems to be a duplicate across all the failures. I am using Jupyter notebook (Anaconda 3, Python 3.6). Code that fails to generate output is found below (but my data table and everything else is correct). ** I am unsure if there's some problem with the Plotly library (I'm using Plotly's latest that I installed using "Pip install Plotly")

Why plotly area graph is not displaying data properly?

孤人 提交于 2019-12-23 19:27:37
问题 Data is coming from beck end correctly but on graph is not displaying properly sometimes. Why its happening sometimes? I referred this code. Area of graph not filling properly. My graph is looking like this some time: Here is my code: <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <body> <div id="myDiv" style="width: 480px; height: 400px;"><!-- Plotly chart will be drawn

plotly 3d surface - change cube to rectangular space

这一生的挚爱 提交于 2019-12-23 18:52:16
问题 I would like to have a 3d plot that is not in a cube, since my z data is 10 times smaller than the scale of x and y axis. How do you set it up so that the 3d plot is not in a cube, but in a rectangular shape instead? (I would like x, y, z axis to be on the same scale as well. That is, x and y are from 0 to 100, while z is from 0 to 10 in this example:) zz = matrix(c(1:10), nrow = 100, ncol = 100) plot_ly(z=zz, x = c(1:100), y = c(1:100), type = 'surface') %>% layout(autorange = F, aspectmode

R - plotly invisible lines

倖福魔咒の 提交于 2019-12-23 16:10:00
问题 I have a data set df wich contains variables Name(factor), Count(integer) and Time(POSIXct). I'm using the following code: df %>% plot_ly(x=~Time,y = ~Count,group = ~Name,color=~Name,type='scatter', mode='lines+markers') What happen is that the lines don't appear at all (the markers appear perfecly tho). Changing mode to 'lines' makes the data invisible, but the information appear whenever I hover the pointer over data locations. Also note that running without the groups produce the excpected

Plotly python how to draw unbounded lines and spans?

落爺英雄遲暮 提交于 2019-12-23 15:33:46
问题 I am using plotly (the offline version) within an IPython notebook and I like it a lot. However I couldn't find a way to plot a vertical line or a vertical band. The equivalents in matplotlib are: import matplotlib.plyplot as plt plt.axvline(x=0) plt.axvspan(xmin=0, xmax=1) thanks in advance 回答1: You can add shapes to your plotly layout. Shapes can include lines or rectangles. They can also be made unbounded by drawing them relative to the plotting area rather than a particular axis. Have a

Plotly and cufflinks not working in Anaconda

邮差的信 提交于 2019-12-23 13:21:01
问题 I have been doing a course on data science and machine learning and in one of the lesson, it asked me to download and use plotly and cufflinks. I downloaded and installed them successfully, I have imported them successfully as well. But while trying to use them using iplot, it's giving me an error. Below I have attached screenshots of the error so I want to know how to solve this error and use plotly and cufflinks without any issue. The code that I wrote: import pandas as pd import numpy as

Python ggplot and ggplotly

女生的网名这么多〃 提交于 2019-12-23 13:04:30
问题 Former R user, I used to combine extensively ggplot and plot_ly libraries via the ggplotly() function to display data. Newly arrived in Python, I see that the ggplot library is available, but cant find anything on a simple combination with plotly for graphical reactive displays. What I would look for is something like : from ggplot import* import numpy as np import pandas as pd a = pd.DataFrame({'grid': np.arange(-4, 4), 'test_data': np.random.random_integers(0, 10,8)}) p2 = ggplot(a, aes(x =

Discrete colorbar in R plotly

拥有回忆 提交于 2019-12-23 13:04:04
问题 I am trying to produce a Heatmap with R plotly. This is the reproducible example: test <- structure(list(s1 = c(0L, 0L, 1L, 0L, 1L, 1L), s2 = c(1L, 1L, 0L, 1L, 0L, 0L), s3 = c(0L, 0L, 0L, 0L, 0L, 0L), s4 = c(0L, 0L, 0L, 0L, 0L, 0L), s5 = c(0L, 0L, 0L, 0L, 0L, 0L), s6 = c(0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("s1", "s2", "s3", "s4", "s5", "s6" ), row.names = c("5HT2 type receptor mediated signaling pathway", "5HT3 type receptor mediated signaling pathway", "5-Hydroxytryptamine degredation",

Discrete colorbar in R plotly

淺唱寂寞╮ 提交于 2019-12-23 13:02:32
问题 I am trying to produce a Heatmap with R plotly. This is the reproducible example: test <- structure(list(s1 = c(0L, 0L, 1L, 0L, 1L, 1L), s2 = c(1L, 1L, 0L, 1L, 0L, 0L), s3 = c(0L, 0L, 0L, 0L, 0L, 0L), s4 = c(0L, 0L, 0L, 0L, 0L, 0L), s5 = c(0L, 0L, 0L, 0L, 0L, 0L), s6 = c(0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("s1", "s2", "s3", "s4", "s5", "s6" ), row.names = c("5HT2 type receptor mediated signaling pathway", "5HT3 type receptor mediated signaling pathway", "5-Hydroxytryptamine degredation",

plotly regression line R

会有一股神秘感。 提交于 2019-12-23 12:41:55
问题 Problem with adding a regression line to a 'plotly' scatter plot. I've done the following code: require(plotly) data(airquality) ## Scatter plot ## c <- plot_ly(data = airquality, x = Wind, y = Ozone, type = "scatter", mode = "markers" ) c ## Adding regression line (HERE IS THE PROBLEM) ## g <- add_trace(c, x = Wind, y = fitted(lm(Ozone ~ Wind, airquality)), mode = "lines" ) g 回答1: I reckon it's caused by the missing values airq <- airquality %>% filter(!is.na(Ozone)) fit <- lm(Ozone ~ Wind,