-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Annotations issues on distplots with plotly 3.1.0 #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @rickantonais , Thanks for taking the time to let us know. I believe this is a duplicate of #1072. In version 3 there's a problem using Until a fix is out you can use property assignment to update the annotations. For example: fig_var=ff.create_distplot(data_var,labels,bin_size=0.00005,curve_type="normal",show_hist=True,show_rug=False)
fig_var['layout'].update(title='Distribution of potential loss/returns',
titlefont=dict(color='#FFF'),
legend=dict(
font=dict(color='#FFF')),
plot_bgcolor='#000000',
paper_bgcolor='#000000',
xaxis=dict(title='Loss -- Returns (%)',
titlefont=dict(color='#5998ff'),
mirror='ticks',
linecolor='#5998ff',
linewidth=3,
tickfont=dict(
family='Old Standard TT, serif',
color='white')
),
yaxis=dict(title='Number of minutes',
titlefont=dict(color='#5998ff'),
mirror='ticks',
linecolor='#5998ff',
linewidth=3,
showticklabels=False
)
)
fig_var.layout.annotations=[
dict(
x=VaR_95,
y=0,
xref='x',
yref='y',
text='VaR 95',
font=dict(color='#F00'),
showarrow=True,
arrowhead=7,
ax=0,
ay=-350,
arrowcolor='#F00'
),
dict(
x=CVaR_95,
y=0,
xref='x',
yref='y',
text='Expected Shorfall',
font=dict(color='#F00'),
showarrow=True,
arrowhead=7,
ax=0,
ay=-300,
arrowcolor='#F00'
)
] Or you can downgrade back to version 2.7 and wait until a fix for #1072 is released (probably a couple of weeks). Thanks! |
Hi, I am seeing this exact issue in |
Hello, I've had a new computer at work so I had to reinstall all packages and so on to get plotly and re-use my work I've done before,
I just noticed that when I wanted to add 1 notation, it did work, but when I wanted to add multiple notations (2 in my case), it didn't appear at all.
Here is how I did code in python 3:
in version 3.1.0, it didn't show any annotations and didn't mirror my blue lineborder either
whereas in version 2.7.0, it worked perfectly as expected.
Here is what I expect and working in plotly 2.7.0 :
and here is the version 3.1.0 :
Does any of you has had an annotation issue related just like I did ? For another scatter plot, annotation worked but it seems not working for distplot here
Question: is there anything changed about annotations in the new version 3 plotly ?
NB: I didn't change the code in between the 2 versions, it was exactly the same.
Thank you for reading
The text was updated successfully, but these errors were encountered: