-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
set the yaxis parameters(tickformat='p') #1537
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 @fenghuoqiuqiu, thanks for the report. I've opened a corresponding issue with the JavaScript library at plotly/plotly.js#3814. As a workaround, you can manually specify the number of decimal places using the import plotly.offline as py
from plotly.graph_objs import Scatter, Layout
import plotly.graph_objs as go
py.init_notebook_mode(connected=True)
trace1=go.Scatter(
name="lenged2",
x=['2018-01','2018-02','2018-03','2018-04','2018-05','2018-06','2018-07','2018-08','2018-09'],
y=[0.1,0.3,0.5,0.4,0.7,0.3,0.4,0.2,0.4,0.5],
)
layout=go.Layout(
showlegend=True,
legend=dict(x=1.05,y=1.1),
xaxis=dict(showticklabels=True),
yaxis=dict(
tickformat='.0%',
showgrid=False,
))
data=[trace1]
fig=go.Figure(data=data, layout=layout)
py.iplot(fig) |
thank you for your help,but it remains an unsettling question,I want to use percentage format(retain four decimal,eg. 20.22%) . |
|
Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson |
I want to use percentage format(retain four decimal) ,When I set the yaxis parameters(tickformat='p'), but there are always some display problems.
This is my code:
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: