plotly

Plotly: How to set up multiple subplots with grouped legends?

|▌冷眼眸甩不掉的悲伤 提交于 2020-12-13 05:40:24
问题 for each subplot I have 3 seperate line:2017 ,2018 and 2019 with 3 times "go.Scatter", each subplot represents one country (25 countries) with always these 3 years. I can use the subplot sample code but then all the 75 legends (25 X 3) will be all together with different colors and it's messy. I don't need different colors amont different subplot, I can just have 3 different colors and 3 legends for the 3 years on all subplots, would be ideal if I click on for example 2017 that all the 2017

Removing Unused Subplot in R Plotly

笑着哭i 提交于 2020-12-13 03:37:25
问题 When using plotly (in R), after combining subplots there remains an unused and blank subplot. I've recreated the issue using the ggplot2 dataset mpg below. library(dplyr) library(ggplot2) library(plotly) audi <- mpg %>% filter(manufacturer == "audi") chevy <- mpg %>% filter(manufacturer == "chevrolet") fig1 <- plot_ly(audi, x = ~hwy, y = ~year, name = "", type = 'scatter', mode = "markers", marker = list(color = "blue", symbol = 'x-dot')) fig2 <- plot_ly(chevy, x = ~hwy, y = ~year, name = "",

Removing Unused Subplot in R Plotly

霸气de小男生 提交于 2020-12-13 03:36:54
问题 When using plotly (in R), after combining subplots there remains an unused and blank subplot. I've recreated the issue using the ggplot2 dataset mpg below. library(dplyr) library(ggplot2) library(plotly) audi <- mpg %>% filter(manufacturer == "audi") chevy <- mpg %>% filter(manufacturer == "chevrolet") fig1 <- plot_ly(audi, x = ~hwy, y = ~year, name = "", type = 'scatter', mode = "markers", marker = list(color = "blue", symbol = 'x-dot')) fig2 <- plot_ly(chevy, x = ~hwy, y = ~year, name = "",

Plotly-Dash: How to code interactive callbacks for hover functions in plotly dash

邮差的信 提交于 2020-12-13 03:19:18
问题 Is it possible to have a text field at the bottom of a graph in dash that displays the text for the point they are on (showing hover data as plain text). So the text box will be able to make changes when users hover over a certain point. I have defined a dcc.Graph component and the app layout but am not sure how to define the callback function for the hoverdata. I have used the below code to define dcc.Graph and app.layout fig = go.Figure(data=plot_data, layout=plot_layout) app.layout = html

Plotly: How to make a multiple index dropdown option?

三世轮回 提交于 2020-12-13 03:13:10
问题 I have data with same index number for different timeframe as below Time CallOI PutOI CallLTP PutLTP 29500 3:30 PM 502725 554775 343.70 85.50 29500 3:15 PM 568725 629700 357.15 81.70 29500 2:59 PM 719350 689850 337.85 95.45 29500 2:45 PM 786975 641575 360.00 108.35 29500 2:30 PM 823500 626875 336.50 127.80 29500 2:15 PM 812450 631800 308.55 143.00 29500 2:00 PM 974700 617750 389.80 120.00 29500 1:45 PM 1072675 547100 262.55 186.85 29500 1:30 PM 1272300 469600 206.85 232.00 29600 3:30 PM

How to remove trace0 here?

社会主义新天地 提交于 2020-12-12 11:44:32
问题 The info "trace0" always shows beside the hover text box of the blue line, How can I remove it? Why not on the orange line? What the trace0 exactly mean? library(plotly) fig <- plot_ly() fig <- fig %>% add_trace( type = 'scatter', mode = 'lines+markers', x = c(1,2,3,4,5), y = c(2.02825,1.63728,6.83839,4.8485,4.73463), text = c("Text A", "Text B", "Text C", "Text D", "Text E"), hovertemplate = paste('<i>Price</i>: $%{y:.2f}', '<br><b>X</b>: %{x}<br>', '<b>%{text}</b>'), showlegend = FALSE )

Python Plotly: Adding a horizontal line to a scatter plot that has multiple subplots

徘徊边缘 提交于 2020-12-12 10:24:45
问题 I have a scatter plot that is running on Plotly dash. This is the code: import dash import dash_core_components as dcc import dash_html_components as html import plotly import plotly.graph_objs as go from plotly.subplots import make_subplots import numpy as np fig = make_subplots(rows=2, cols=3, vertical_spacing=0, horizontal_spacing=0.05, shared_xaxes=True, shared_yaxes=False) fig.add_trace(go.Scatter(x=list(range(40)), y=np.random.randint(20, 40, 40), line_color='#fae823', showlegend=False,

Plotly-Dash: How to design the layout using dash bootstrap components?

最后都变了- 提交于 2020-12-12 08:30:40
问题 I'm very new to Dash Plotly and I'm trying to figure out how can I design a layout like this. Layout: As I understood, this can be done more easy using dash bootstrap components. https://dash-bootstrap-components.opensource.faculty.ai As a first step I should reproduce the layout (grey tiles) and as a second step, I should add some text and some graphs. Just basic. Thank you. 回答1: You should check out this link to learn more about Dash Bootstrap Components, and how to structure your layout. I

Plotly-Dash: How to design the layout using dash bootstrap components?

こ雲淡風輕ζ 提交于 2020-12-12 08:30:27
问题 I'm very new to Dash Plotly and I'm trying to figure out how can I design a layout like this. Layout: As I understood, this can be done more easy using dash bootstrap components. https://dash-bootstrap-components.opensource.faculty.ai As a first step I should reproduce the layout (grey tiles) and as a second step, I should add some text and some graphs. Just basic. Thank you. 回答1: You should check out this link to learn more about Dash Bootstrap Components, and how to structure your layout. I

Plotly: How to show more than 2 x-axes titles/ranges on the same subplot?

戏子无情 提交于 2020-12-12 05:40:35
问题 I'm using Plotly and making scatter plot subplots with a shared y-axis and different x-axes. I have attempted to use the figure object (fig['layout'][data index]) syntax to show multiple stacked x-axes and their respective ranges. I have only been successful in showing two xaxes and ranges per subplot by assigning 'top' and 'bottom' to the side attribute of the figure layout. The 2nd column from the right in figure below should show titles/ranges for series T5, T6, and T7 but only the title