plotly

Adding data to a displayed map on mapbox

痞子三分冷 提交于 2019-12-10 11:46:52
问题 I know how to display a map now from this here. But what I want to do is now add data to it, sort of like what this link does here. Eventually I need to call a python function that returns this data that gives coloring to a particular area which looks like this: [{'type': 'scattermapbox', 'mode': 'markers', 'text': ['Census Tract:304.01<br> Predicted Growth Rank:1.0<br> Year: 2017 '], 'marker': {'size': 1, 'color': ['rgba(247, 251, 255, 255)'], 'colorscale': [[0.0, 'rgba(8, 48, 107, 255)'],

coupled event in Plotly's bar-plot

落爺英雄遲暮 提交于 2019-12-10 11:39:35
问题 I have a bar-plot the click action of which produces another plot alongside the bar-plot. As of now the user can only click on one agegroup and have the corresponding race distribution. Is there a way to enable multiple agegroup selections and subset the race data accordingly ? Took inspiration of this plot from https://plot.ly/r/shiny-coupled-events/ The code is as under ui <- fluidPage( theme = shinytheme("spacelab"), h2("Coupled events in plotly charts using Shiny"), h4("This Shiny app

Plotting data of deedle data frame with Xplot plotly

血红的双手。 提交于 2019-12-10 11:16:47
问题 I have a Deedle data frame with DateTime values as key and two columns with data. Now I want to plot the data of column 1 with a Scatter chart from Plotly. I am using FSLab and there is XPlot.Plotly 1.3.1 included. But I can't use Plotly: open XPlot.Plotly.Graph open XPlot.Plotly open XPlot.Plotly.HTML let dataFrame = ... Scatter( x = dataFrame.ColumnKeys, y = dataFrame.GetColumn("col1") ) |> Chart.Plot |> Chart.Show I'm getting this error: "The field, constructor or member 'Plot' is not

Plot ellipse3d in R plotly?

梦想的初衷 提交于 2019-12-10 10:54:25
问题 Package rgl includes a very useful function ellipse3d , which can return an ellipsoid that cover like 95% percent of the points in 3D. Then this object can be used in rgl::plot3d to plot it out. My question is that is it possible to convert the output of ellipse3d to something that can be plotted through js plotting packages like plotly? library(rgl) dt <- cbind(x = rnorm(100), y = rnorm(100), z = rnorm(100)) ellipse <- ellipse3d(cov(dt)) plot3d(dt) plot3d(ellipse, add = T, color = "red",

Graphing date vs time on plotly

被刻印的时光 ゝ 提交于 2019-12-10 10:37:13
问题 I have several data sets I would like to plot with dates as X axis and times as Y axis. I am working in Jupyter Notebook. from datetime import date, time from plotly import offline as py from plotly.graph_objs import Scatter, Data py.init_notebook_mode(connected=True) meetings = Scatter( x=[date(2017, 1, 1), date(2017, 1, 3), date(2017, 1, 3)], y=[time(8, 0, 0), time(12, 0, 0), time(16, 0, 0)], text=['work meeting 1', 'work meeting 1', 'work meeting 1'], mode='markers' ) workouts = Scatter( x

Plotting Ellipse3d in R Plotly with surface ellipse

扶醉桌前 提交于 2019-12-10 10:11:15
问题 Similar to the question here but this didn't give me excatly what I needed and I couldn't figure it out: Plot ellipse3d in R plotly?. I want to recreate rgl's ellipse3d and surface ellipsoid in plotly. I know there there was an anwer which allowed plotting of an ellipse but as individual opaque markers, I need to get it as a surface ellipsoid that's slightly opaque so I can still see the data points in the ellipsoid. I tried to figure out how dww's comment for "add_surface" instead works but

How to display plotly outputs in google collaboratory notebooks?

隐身守侯 提交于 2019-12-10 09:33:42
问题 I searched whole day how to display the outputs of plotly plots in google colaboratory jupyter notebooks. There is a stackoverflow question and also official tutorial from google colaboratory but both of them did not work for me. official link: https://colab.research.google.com/notebooks/charts.ipynb#scrollTo=hFCg8XrdO4xj stackoverflow question: Plotly notebook mode with google colaboratory https://colab.research.google.com/drive/14oudHx5e5r7hm1QcbZ24FVHXgVPD0k8f#scrollTo=8RCjUVpi2_xd The

Update plotly in R without recreating widget when plotted data is altered

大兔子大兔子 提交于 2019-12-10 07:41:58
问题 Everytime a plotly object is created by R in shiny, (or just in R), the widget is recreated completely. For small data sets this is not a problem, but i'm working with plots that contain thousands of scatter points, making it take 10-20 seconds to recreate a plot in my shinyapp. I'm looking for a way to update the data through a javascript solution that doesn't trigger the widget to be rebuild, but simply replaces it's data. Here is a dummy app with 2 small data sets between which the app can

add multiple lines to a plot_ly graph with add_trace

痞子三分冷 提交于 2019-12-10 03:09:13
问题 I found an example to add lines to a plot_ly plot by using the add_trace command. How can I add a list of lines to plot without using add_trace multiple times? I tried a for loop to add the traces but this doesn't work as expected. my_lines <- list( list(x=1:10, y=2:11, color='red'), list(x=1:10, y=0:9, color='blue'), list(x=1:10, y=3:12, color='green') ) p <- plot_ly() p for(line in my_lines) { p <- add_trace(p, y=line[['y']], x=line[['x']], marker=list(color=line[['color']])) } p But this

Open a url by clicking a data point in plotly?

≡放荡痞女 提交于 2019-12-10 02:24:50
问题 I have successfully created plotly graphs from python, and gone as far as creating custom html tooltips for the datapoints. But I haven't succeeded in adding functionality to open a link if someone clicks on a datapoint. What I would like is a separate tab to pop up showing more information linked to that particular data point. Can anyone think of a way to achieve this with plotly? 回答1: It's not quite possible yet, but the best option might be to include a link in the text as hover, here is