plotly

Plotly: How to update one specific trace using updatemenus?

℡╲_俬逩灬. 提交于 2020-01-06 05:17:01
问题 This is a follow-up question to Plotly: Plotly: How do the buttons for the update menus really work? Consider the following plotly figure produced by the code snippet below: Plot: Code: # imports import plotly.graph_objs as go import pandas as pd import numpy as np # data df1 = pd.DataFrame({'index': ['1','2','3'], 'A': [10,10,12], 'B': [11,11,11]}) df2 = pd.DataFrame({'index': ['1','2','3'], 'A': [10,10,10], 'B': [11,11,12]}) # plotly figure setup fig=go.Figure() fig.add_trace(go.Scatter(x

Plotly: How to update one specific trace using updatemenus?

风流意气都作罢 提交于 2020-01-06 05:16:04
问题 This is a follow-up question to Plotly: Plotly: How do the buttons for the update menus really work? Consider the following plotly figure produced by the code snippet below: Plot: Code: # imports import plotly.graph_objs as go import pandas as pd import numpy as np # data df1 = pd.DataFrame({'index': ['1','2','3'], 'A': [10,10,12], 'B': [11,11,11]}) df2 = pd.DataFrame({'index': ['1','2','3'], 'A': [10,10,10], 'B': [11,11,12]}) # plotly figure setup fig=go.Figure() fig.add_trace(go.Scatter(x

unable to show graph when dropdown list is cleared in Dash plotly

孤人 提交于 2020-01-06 04:32:16
问题 I built a dash app to show scatter plot of total_bill vs tip from tips dataset. I have a dropdown menu that allows multiple selection of days, so that I can color the scatter plot by those selected days . What I need is when nothing is selected from dropdown, the scatter plot is colored by all days. When one or multiple days are selected through dropdown, the scatter plot is colored just by those selected days. My app code is below. The issue is when I clear the dropdown, the graph also

unable to show graph when dropdown list is cleared in Dash plotly

被刻印的时光 ゝ 提交于 2020-01-06 04:32:02
问题 I built a dash app to show scatter plot of total_bill vs tip from tips dataset. I have a dropdown menu that allows multiple selection of days, so that I can color the scatter plot by those selected days . What I need is when nothing is selected from dropdown, the scatter plot is colored by all days. When one or multiple days are selected through dropdown, the scatter plot is colored just by those selected days. My app code is below. The issue is when I clear the dropdown, the graph also

Smooth 3D trangular mesh in R

心已入冬 提交于 2020-01-05 16:29:51
问题 I am drawing a 3D surface mesh of human face. Data can be found at https://github.com/Patricklv/Smoothing-3D-surface, where vb.xlsx contains vertices and it.xlsx contains faces. My R code is as follows: library(xlsx) library(rgl) vb <- read.xlsx("C:\\Users\\<Username>\\Desktop\\vb.xlsx", sheetIndex = 1, header = F) it <- read.xlsx("C:\\Users\\<Username>\\Desktop\\it.xlsx", sheetIndex = 1, header = F) vb_mat <- t(as.matrix(vb)) vb_mat <- rbind(vb_mat, 1) rownames(vb_mat) <- c("xpts", "ypts",

Smooth 3D trangular mesh in R

大憨熊 提交于 2020-01-05 16:29:27
问题 I am drawing a 3D surface mesh of human face. Data can be found at https://github.com/Patricklv/Smoothing-3D-surface, where vb.xlsx contains vertices and it.xlsx contains faces. My R code is as follows: library(xlsx) library(rgl) vb <- read.xlsx("C:\\Users\\<Username>\\Desktop\\vb.xlsx", sheetIndex = 1, header = F) it <- read.xlsx("C:\\Users\\<Username>\\Desktop\\it.xlsx", sheetIndex = 1, header = F) vb_mat <- t(as.matrix(vb)) vb_mat <- rbind(vb_mat, 1) rownames(vb_mat) <- c("xpts", "ypts",

Scaling points and choosing colors with plot_ly R package

有些话、适合烂在心里 提交于 2020-01-05 07:12:40
问题 I have just started using plotly in R and it is working great but I cannot figure out how to do two things. 1) I need to pick the colors of my split. Currently, I am splitting by Territory and plotly doesn't allow me to code what colors I want each territory to be. 2) I also need to scale the points so that some markers are very large. I tried creating a size for each row and setting size = ~size and sizes = c(2, 100) but this did not work. Any advice on how to do this? I've tried reading the

How to disable trendline in plotly.express.line?

◇◆丶佛笑我妖孽 提交于 2020-01-05 04:31:46
问题 I am willing to plot 3 timeseries on the same chart. Datasource is a pandas.DataFrame() object, the type of Timestamp being datetime.date , and the 3 different time series drawn from the same column Value using the color argument of plotly.express.line() . The 3 lines show on the chart, but each one is accompanied by some sort of trendline. I can't see in the function signature how to disable those trendlines. Can you please help? I have made several attempts, e.g. using another color , but

Plotly - Set line color

眉间皱痕 提交于 2020-01-05 04:20:57
问题 How can I set the color of a line in plotly ? import plotly.graph_objects as go from plotly.subplots import make_subplots fig = make_subplots(rows=2, cols=1, subplot_titles=('Plot 1', 'Plot 2')) # plot the first line of the first plot fig.append_trace(go.Scatter(x=self.x_axis_pd, y=self.y_1, mode='lines+markers', name='line#1'), row=1, col=1) # this line should be #ffe476 I tried fillcolor but that I suspected doesn't work because this is a simple line. 回答1: You can add line=dict(color="

“Split” up by category in plotly

橙三吉。 提交于 2020-01-05 03:47:06
问题 I am trying to plot my scatter points in plotly, each with a specified color by category. It works fine until I start to use "split" (this line of code shows the legend) and should, by description "split" the categorial variable up, into different categories. This is a reproducible example: # Load data df_soccer <- data.frame("x" = 1:4, "y" = 2:5, "Name" = c("Manchester United", "FC Barcelona", "FC Porto", "Borussia Dortmund"), "soc_color" = c("rgb(218, 2, 14)","rgb(167, 0, 66)", "rgb(0, 147,