Plotly surface plots only partially support SVG / PDF #551
Unanswered
karhunenloeve
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Thanks so much @karhunenloeve for raising this point so well. One question: why are Betti curves affected by this? The way I see it, they are 2D plots and the only 3D plots we do offer at the moment are the Betti surfaces which you mentioned. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I started this thread after a discussion at this year's NeuRIPS with one of the authors of the paper on giotto-TDA last published at the topology workshop.
The use of plotly as a library for plotting larger data sets somewhat limits the usability of the tool for publications in my view, for the following reason:
The 3D-surface plot of the plotly library embeds the resulting surface in a PDF or SVG. For 2D curves and point clouds, the elements can then be modified as vector graphics and prepared accordingly for publications. However, if you want to combine Betti curves in a 3D plot, or silhouettes or similar, the graphics are not embedded as vector graphics but first written to a PNG, which is then embedded in the SVG or PDF. This seems a bit pointless to me, although it is certainly done for memory reasons. This is because scalability is lost and the resolution is also not determinable by the user.
Plots I have come across that have this problem in giotto-TDA would be:
https://giotto-ai.github.io/gtda-docs/0.3.1/modules/generated/plotting/gtda.plotting.plot_betti_curves.htmlA similar thread was opened here: #387.
A suggestion would be to implement an alternate plot method for said functions, and according to that method, perform the plot optionally. Plotly understandably has its merits, but from my point of view it is not particularly suitable for generating publication-ready graphics.
For a minimal working example of this problem, choose any surface plot from plotly (like for example here: https://plotly.com/python/3d-surface-plots/). Then save the file as PDF or SVG using the
.write_image()
method. Just open it in Inkscape or another program for vector graphics and right click onungroup
. Then you should see the exposed PNG. Alternatively, you can simply examine the XML for the embedded PNG.What do you think about it?
Is there anyone who has found a working workaround?
Beta Was this translation helpful? Give feedback.
All reactions