plotly

how to loop to create subplots in Plotly, where each subplot has a few curves on it?

旧时模样 提交于 2021-02-11 13:45:16
问题 I already wrote below nested loops to generate 21 charts with success (one chart for each country, for example german gas austrian gas) dfs is a dict with 21 countries names as keys and their respective gas storage dfs as values for country in list(dfs_storage.keys()): df_country=dfs_storage[country] month = list(set(df_country['month'])) fig = go.Figure() for year in set(df_country['year']): workingGasVolume_peryear=df_country.loc[df_country['year']==year,'workingGasVolume'] gasInStorage

Display given value in XY axis - Plotly

浪子不回头ぞ 提交于 2021-02-11 13:41:33
问题 I am trying to display 1,1.5,4,7,9 in X axis and 2.5,1,5,3 in Y axis. When I tried to do this, my output is like 1, 1.5, 2, 2.5,...... which is basically breakdown of values which I have given. I want only values which I have given in XY axis and I don't want auto range(Scroll value). 回答1: Assuming you are using JavaScript since you tagged angular. You are going to have to set three attributes to make this work: tickvals, ticktext, and tickmode. In the documentation you they tell you:

Plotly Annotation covered by the Node and Background [closed]

无人久伴 提交于 2021-02-11 12:48:57
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 days ago . Improve this question I've followed the example on plotting the tree from https://plotly.com/python/tree-plots/. However, I've a very long annotation but it is covered by the background such that it is cut off. Is it possible to annotate it outside the circle? I've pasted the code below. It can be run

Integrating Plotly inside WxPython

邮差的信 提交于 2021-02-11 12:43:53
问题 Plotly says it is a web library. Matplotlib does support Wxpython but comparatively, it is too low level. Is there any way to integrate Plotly inside a Wxpython GUI or are there any alternative for it? 回答1: You might be able to use Plotly's ability to export plots to images to get the plots into wxPython: https://plot.ly/python/offline/#static-image-export If you need the live plotting though, then you will need to use Webview: https://wxpython.org/Phoenix/docs/html/wx.html2.WebView.html I

Integrating Plotly inside WxPython

允我心安 提交于 2021-02-11 12:43:39
问题 Plotly says it is a web library. Matplotlib does support Wxpython but comparatively, it is too low level. Is there any way to integrate Plotly inside a Wxpython GUI or are there any alternative for it? 回答1: You might be able to use Plotly's ability to export plots to images to get the plots into wxPython: https://plot.ly/python/offline/#static-image-export If you need the live plotting though, then you will need to use Webview: https://wxpython.org/Phoenix/docs/html/wx.html2.WebView.html I

R: Kernel Density Plots (Bandwidth Must be Strictly Positive)

烂漫一生 提交于 2021-02-11 12:38:03
问题 I am using the R programming language. I am following this tutorial over here for making 3d kernel density plots in R: https://plotly.com/r/3d-surface-plots/: library(MASS) library(plotly) kd <- with(MASS::geyser, MASS::kde2d(duration, waiting, n = 50)) fig <- plot_ly(x = kd$x, y = kd$y, z = kd$z) %>% add_surface() fig I decided to try this on my own data : #generate data a = rnorm(100,10,10) b = rnorm(100,5,5) c = rnorm(100,5,10) d = data.frame(a,b,c) #make 3d plot (I think n = 50 refers to

plotly: exposing the “config” object in the stored JSON string, for easier use with Plotly.JS functions

大城市里の小女人 提交于 2021-02-11 12:33:33
问题 I don't know whether this is a plotly question or an htmlwidgets question. Maybe it's both. I am using R to make plotly widgets, which are -- when made from R -- also htmlwidgets. When making plotly widgets in this way, the resulting HTML contains a stringified JSON object that includes the data and some settings for the widget. But only some parts of this JSON object are easily accessed from a Javascript console. For example, the "data" and "layout" objects are easily accessed, but the

How to change subplot size and decrease space between subplot?

元气小坏坏 提交于 2021-02-11 12:29:16
问题 I created a subplot with plotly and need some advise on formating. How to adjust the piechart so that there is no overlap between labels and title? Sure i can just columns_width and rows_height but the overlap remains. Moreover, is there function similiar to matplotlibs hspace/wspace? Code: from plotly.subplots import make_subplots import plotly.graph_objects as go years = [1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999

Plotly: manual fillcolor for boxplot

白昼怎懂夜的黑 提交于 2021-02-11 12:29:06
问题 I've a boxplot, but I want to use manual colors for the fill of eachone. code: p <- plot_ly(tvs, x = ~ecommerce, y = ~precio_actual, color = ~ecommerce, type = "box") %>% layout(boxmode = "group") p colors I need to use: ecommerce_colors <- c("lacuracao" = "#ffda33","ripley" = "#802D69","falabella" = "#BED800", 'wong' = "red", "tottus" = "#fa3e14") 来源: https://stackoverflow.com/questions/56879211/plotly-manual-fillcolor-for-boxplot

How to highlight a plotline chart with vertical color bar for specific weekdays (saturday and sunday)? [duplicate]

冷暖自知 提交于 2021-02-11 06:52:11
问题 This question already has answers here : how to highlight weekends for time series line plot in python (2 answers) Closed 3 days ago . i plotted a daily line plot for flights and i would like to highlight all the saturdays and sundays. I'm trying to do it with axvspan but i'm struggling with the use of it? Any suggestions on how can this be coded? (flights.loc[flights['date'].dt.month.between(1, 2), 'date'] .dt.to_period('D') .value_counts() .sort_index() .plot(kind="line",figsize=(12,6)) )