-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Ploty image.save.as can't complete display Chinese #1106
Comments
Hi @zhonon , thanks for the report, I can see what you mean. Here's the full example I used: import plotly.graph_objs as go
import plotly.plotly as ply
fig = go.Figure(data=[go.Scatter(y=[2, 1, 4])])
chinese_char_str = '客戶數'
fig.layout.yaxis.title = chinese_char_str
ply.image.save_as(fig, filename='chinese_char_test.png') The good news is that when I test this using an early prototype version of our coming Orca integration for static image export it works properly: You can learn more about the orca project at https://github.com/plotly/orca. Orca will be well integrated into plotly.py for version 3.2, but in the meantime you can install and run it as a command line application (See instructions in the README linked above). Orca has a lot of advantages of the If you're interested in how this all comes together please check out the links above and let us know what you think. |
thinks for you Answer。 |
Have you tried displaying the figure and then saving it from the save
button on the toolbar?
(I'm on my phone so I can't test it right now)
…On Mon, Aug 13, 2018, 11:47 AM zhonon ***@***.***> wrote:
thinks for you Answer。
so,there is no others way to solve this ?
i just want use this image in Email.
and solve this as simple as possible.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1106 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOXdLaCZJUd003fFr7US8sqDwkeC0YXGks5uQZ-HgaJpZM4V57Z7>
.
|
i have try Method on |
Hi @zhonon , Here's what I mean about using the toolbar to save the image. Display the plot using one of the import plotly.graph_objs as go
import plotly.plotly as ply
fig = go.Figure(data=[go.Scatter(y=[2, 1, 4])])
chinese_char_str = '客戶數'
fig.layout.yaxis.title = chinese_char_str
ply.plot(fig, filename='chinese_char_test.png', auto_open=True) This will open the plot in a new browser tab. Then click the camera button in the toolbar to download the plot as a .png. Here's a screen capture of the process: Hope that helps! |
This use-case is now covered by the orca-based static image export coming in 3.2.0. See #1120 |
Update: Programmatic static image export support has been released in 3.2.0: See https://medium.com/@plotlygraphs/plotly-py-end-of-summer-updates-5422c98b9058 |
when i use plotly func
plotly.plotly.image.save_as(self.fig, filename=filepath + '.png')
there is problem,it cannot complete display ,not only Traditional-Chinese but also Simplified -Chinese,and Simplified -Chinese is more serious, i think the problem is on unicode,but i can't find where to change it .
plotly.plotly.image.save_as(self.fig, filename=filepath + '.png')
self.fig['layout']['yaxis4']['title'] = '客戶數'
self.fig['layout']['yaxis4']['titlefont'] = dict(size=11)
self.fig['layout']['yaxis5']['title'] = '客戶勝率'
self.fig['layout']['yaxis5']['titlefont'] = dict(size=11)
The text was updated successfully, but these errors were encountered: