Skip to content
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

Writing contour plots to SVG takes 20 odd seconds #231

Closed
akhileshraju opened this issue May 8, 2019 · 3 comments
Closed

Writing contour plots to SVG takes 20 odd seconds #231

akhileshraju opened this issue May 8, 2019 · 3 comments

Comments

@akhileshraju
Copy link

akhileshraju commented May 8, 2019

I am trying to use plotly (offline mode) in python along with orca to export contour plots to SVG.
Given below is the function I use to create contour plots and export it to SVG

def plot_contour_filled_to_svg():
            fig = go.Figure(layout=layout)
            fig.add_contour(
                x=x_axis,
                y=y_axis,
                z=scan_data,
                contours=dict(showlines=False),
                colorscale="Jet",
            )
            pio.write_image(
                fig,
                "C:/Users/araju/PycharmProjects/contour_filled.svg",
            )

It takes roughly 20s to create an SVG every single time. Is this expected behavior?

I though maybe file IO part of the write command is causing that delay so instead of the write_image, I used the to_image to get a bytes representation of the same. That didnt help with the runtime either

I ran the orca server manually in debug mode (looked at a few posts in forums) but I dont know how to make sense of it.

image

Can someone help me out?

@etpinard
Copy link
Contributor

etpinard commented May 9, 2019

Thanks for writing in. Can you share the x,y,z data you're trying to export to help us debug?

@akhileshraju
Copy link
Author

Thanks for the quick reply. I did some further digging into my issue. I work behind an enterprise firewall and I suspected that gating/slowing down the orca server somehow. So I tested the same script with same data on a Mac and Win PC outside of the enterprise network and was able to always get plotly+orca to export static images in under 0.3sec.
So at this point I think orca + plotly are not to blame. They are working as they should. Thanks for the great work with orca and plotly 👍 :)

@etpinard
Copy link
Contributor

etpinard commented May 9, 2019

Thanks for the great work with orca and plotly :)

Thanks for the kind words!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants