plotly

How do you rotate the axis of a plot in Plotly?

▼魔方 西西 提交于 2020-08-26 04:53:48
问题 I have the following plot done in Plotly As you can see the X,Y axis are in the traditional way. How can I rotate the axis so that X is plot vertically and Y horizontally (to the left)? (also I would like to modify the reach and separations of each axis) I suppose it has to do something with the layout element. My code if so far layout= go.Layout(title=go.layout.Title(text=title,x=0.5), xaxis={'title':'x[m]'}, yaxis={'title':'y[m]'}) point_plot=[ go.Scatter(x=[series[listoflabels[0]]],y=

How do you rotate the axis of a plot in Plotly?

允我心安 提交于 2020-08-26 04:53:47
问题 I have the following plot done in Plotly As you can see the X,Y axis are in the traditional way. How can I rotate the axis so that X is plot vertically and Y horizontally (to the left)? (also I would like to modify the reach and separations of each axis) I suppose it has to do something with the layout element. My code if so far layout= go.Layout(title=go.layout.Title(text=title,x=0.5), xaxis={'title':'x[m]'}, yaxis={'title':'y[m]'}) point_plot=[ go.Scatter(x=[series[listoflabels[0]]],y=

how to hide plotly yaxis title (in python)?

本小妞迷上赌 提交于 2020-08-25 17:04:10
问题 Editing: The following example from Plotly for reference: import plotly.express as px df = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6") fig = px.bar(df, y='pop', x='country', text='pop') fig.update_traces(texttemplate='%{text:.2s}', textposition='outside') fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide') fig.show() How to remove the word 'pop'. What I want to hide the y-axis title of'value'. The following syntax doesn't work. fig.update

how to hide plotly yaxis title (in python)?

做~自己de王妃 提交于 2020-08-25 17:04:01
问题 Editing: The following example from Plotly for reference: import plotly.express as px df = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6") fig = px.bar(df, y='pop', x='country', text='pop') fig.update_traces(texttemplate='%{text:.2s}', textposition='outside') fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide') fig.show() How to remove the word 'pop'. What I want to hide the y-axis title of'value'. The following syntax doesn't work. fig.update

how to hide plotly yaxis title (in python)?

核能气质少年 提交于 2020-08-25 17:02:37
问题 Editing: The following example from Plotly for reference: import plotly.express as px df = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6") fig = px.bar(df, y='pop', x='country', text='pop') fig.update_traces(texttemplate='%{text:.2s}', textposition='outside') fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide') fig.show() How to remove the word 'pop'. What I want to hide the y-axis title of'value'. The following syntax doesn't work. fig.update

plotly treemap element with “href” not working with local relative html paths

我是研究僧i 提交于 2020-08-25 04:02:14
问题 I have simple table with href inside the text. The href points to relative path of local html file. But clicking on it doesn't open the page. is there any way to do that/ good workaround? The folder structure is following. As the root will be changed, so the relative path is needed. --root --root/index.html --root/files/file1.html --root/files/file2.html import plotly.express as px df = px.data.gapminder().query("year == 2007") link_ref = '<a href="files/file1.html">{}</a>' df['country'] = df

Plotly: how to make an unbounded vertical line in a subplot?

我的梦境 提交于 2020-08-24 10:29:11
问题 The goal is to get vertical infinite lines in every subplot, at x=1. In this example, I'll just try a single plotly shape of type="line" in the first row, first column from plotly.subplots import make_subplots import plotly.graph_objects as go import numpy as np fig = make_subplots( rows=2, cols=2, subplot_titles=list(map(str, range(4))), shared_xaxes=True, shared_yaxes=False, ) time = np.linspace(-np.pi, np.pi, 1000) for i in range(4): data = np.sin((i+1) * time) fig.add_trace( go.Scatter(y

Can we keep the caption at the top of plotly objects in html output from rmarkdown?

时光总嘲笑我的痴心妄想 提交于 2020-08-24 06:58:39
问题 The following markdown shows the problem that captions that successfully go to the top of ggplot figures with the use of fig.topcaption=TRUE , but do not with plotly objects. I learnt about fig.topcaption here. The underlying code for the fig.topcaption appears to live here in knitr, though either that is not compatible with plotly figures, or it could be pandoc, or html/html widgets-related, or somewhere else in the chain from the rmarkdown to final output. I'm happy enough with a work

How to remove weekend datetime gaps from x-axis of a financial chart?

跟風遠走 提交于 2020-08-23 07:54:08
问题 I have a use case where I pull and plot Forex data in the form of ask and bid on the graph and this is based on minute, hour or day candlesticks and I am only plotting the closing value for bid and ask as a spline . Issue The endpoints that I am using their Forex data feed is not available from Friday 8pm to Sunday 9pm . Let's say I have the following use case Plot a 200 data points (i.e. hourly candle) on the graph at a time, on new candle phase out the oldest and plot the newest The X-Axis

why does my x axis ticks are not sorted properly in plotly graph

懵懂的女人 提交于 2020-08-19 05:35:12
问题 I am trying to plot a sales trend, over the weeks. But in the x axis, the ticks are not in proper sorted order, there by making my graph look weird. Graph : As you can see , the circled week , needs to come in starting or the axis. Why does this happen like this even after I have sorted the dates in the dataframe ? Pandas Code : basic_df = filterDataFrameByDate(df,start_date,end_date) df = basic_df.groupby(['S2PName',basic_df['S2BillDate'].dt.to_period(flag)], sort=False)['S2PGTotal'].agg([(