plotly

Import error : No module named plotly.plotly

≯℡__Kan透↙ 提交于 2020-01-04 09:19:21
问题 I am working on project and getting this error ImportError: No module named plotly.plotly I tried: pip install plotly pip install --upgrade plotly But import plotly.plotly as py didn't work. 回答1: Not sure if pyzo and python modules are stored at different location on your computer. And how they are referred. But you can try following to give absolute path name for plotly while loading module and see if it works. import sys sys.path.insert(0, c:\pyzo2015a\lib\site-packages\plotly') import

Heat Map of Earthquake by Geocodes

穿精又带淫゛_ 提交于 2020-01-04 05:48:13
问题 I would like to plot the heat of earthquake acceleration at Gilroy California. The following is my data; geocodes of each point is in decimal. lon lat Acc. -121.5897466 36.98443922 0.308722537 -121.5776472 36.98446622 0.343560598 -121.5657399 36.98449289 0.316238725 -121.5528172 36.98452208 0.289579654 -121.5397651 36.98455121 0.278277577 -121.6022388 36.9957913 0.321904187 -121.5897466 36.99578578 0.346187454 -121.57767 36.99578046 0.323865427 -121.5657514 36.99577518 0.296775313 -121

Reproducing a Choropleth Map by using plotly package in R

♀尐吖头ヾ 提交于 2020-01-04 05:33:06
问题 library(plotly) df <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv") df$hover <- with(df, paste(state, '<br>', "Beef", beef, "Dairy", dairy, "<br>", "Fruits", total.fruits, "Veggies", total.veggies, "<br>", "Wheat", wheat, "Corn", corn)) # give state boundaries a white border l <- list(color = toRGB("white"), width = 2) # specify some map projection/options g <- list( scope = 'usa', projection = list(type = 'albers usa'), showlakes = TRUE,

How to avoid plotting missing dates in R plotly

社会主义新天地 提交于 2020-01-04 05:25:14
问题 I need to plot a area chart, it contains financial data and I am using plotly to do so. The problem is, plotly has a feature of detecting the time series format and plots even the missing dates by simply extending a linear line until the next available data input. Is it possible to disable this feature and plot only the time series where data is available? library(plotly) Datetime <- c( "2016-01-05 00:00:00", "2016-01-06 00:00:00", "2016-01-07 00:00:00", "2016-01-08 00:00:00", "2016-01-11 00

How to plot a line with color vector in R Plotly

倖福魔咒の 提交于 2020-01-04 04:08:15
问题 Say I have the following data frame: ret <- rnorm(100, 0, 5) df <- data.frame( x = seq(1, 100, 1), ret = ret, y = 100 + cumsum(ret), col = c(ifelse(ret > 0, "red", "forestgreen"), NA)[-1] ) Here I'm simulating the returns of some fictional financial asset using rnorm named 'ret', and am defining a color vector named 'col' where upticks are green and downticks are red. What I want to produce is something like the following: library(ggplot2) ggplot(df, aes(x=x, y=y)) + geom_line(aes(colour=col,

Retrieving R object attributes in JavaScript - Part 2

假如想象 提交于 2020-01-04 00:46:06
问题 I posted a similar question earlier (Retrieving R object attributes in JavaScript). In that earlier post, I oversimplified my MWE, and so the answer I rewarded unfortunately does not really apply to my real problem. Here, I am showing why I may need to retrieve R object attributes in JavaScript (unless there is another option that I am not aware of). I have a 5-variable dataset with 100 observations. I used hexagon binning and created a scatterplot matrix. Each of the 10 scatterplots has

How to display many points from plotly_click in R Shiny?

不打扰是莪最后的温柔 提交于 2020-01-03 20:13:11
问题 I have a plotly plot in R Shiny. I want to be able to click many points and have them displayed in a table. The plot is working great and I can get 1 plotly_click (via event_data()) to show in a table. How can a grow a vector of many event_data points. Here is some sample code. I was trying to save the event in d_save. Thanks. library(shiny) library(plotly) data1 <- data.frame(cbind(seq(1,1000,1),seq(1,1000,1)*5)) colnames(data1) <- c('index','data') data_points <- data.frame(cbind(seq(1,1000

Color coding error bars in a plotly scatter plot

蹲街弑〆低调 提交于 2020-01-03 13:54:43
问题 I'm trying to create a forest plot with R plotly where I want to color code the effect sizes (points) and their error bars by their corresponding p-values. Here are toy data: set.seed(1) factors <- paste0(1:25,":age") effect.sizes <- rnorm(25,0,1) effect.errors <- abs(rnorm(25,0,1)) p.values <- runif(25,0,1) Here's what I'm trying: library(dplyr) plotly::plot_ly(type='scatter',mode="markers",y=~factors,x=~effect.sizes,color=~p.values,colors=grDevices::colorRamp(c("darkred","gray"))) %>%

input data from slider to change marker colour

拜拜、爱过 提交于 2020-01-03 13:39:31
问题 Appreciate any help on this task! I'm trying to have this dash app take slider input value to change a variable through a function and then change the marker colour variable only. The code is written in python and uses plotly-dash and plotly and as well as pandas numpy and mapbox. The top part of the code is getting the data into the right format. It has traffic data which is being processed to product a heatmap that shows congestion over time on a map. The dataframe DF is for volume of

input data from slider to change marker colour

扶醉桌前 提交于 2020-01-03 13:39:11
问题 Appreciate any help on this task! I'm trying to have this dash app take slider input value to change a variable through a function and then change the marker colour variable only. The code is written in python and uses plotly-dash and plotly and as well as pandas numpy and mapbox. The top part of the code is getting the data into the right format. It has traffic data which is being processed to product a heatmap that shows congestion over time on a map. The dataframe DF is for volume of