I noticed you save all the plot data in the json files and was wondering whether you could add an option to download a plot in png,eps,etc. that is generated by the server using matplotlib.
If this is against plotly's terms of service, could you at least allow us to save the data as csv files or something similar? That way users can get higher quality plots with excel, python, etc. for using in presentations or papers!
I was thinking of creating a small tool that would read the json file, find a specific window and recreate the plot with maplotlib using the provided data, but it would be even better if it is implemented straight into visdom! :+1:
Matplotlib integration is, indeed, on our roadmap for visdom.
We haven't quite decided how to implement this exactly. I was thinking it would make sense to add an optional argument to each client function that lets you choose the backend used for rendering the plot. If you choose the plotly backend, you get the interactivity but limited ability to export the resulting plot (unless you have a plotly license); if you choose the matplotlib backend, you get a more static plot but you can export publication-quality PNG / EPS files.
Suggestions for alternative ways to implement this are welcome though!
Why not have both?
Use plotly for the interactive plots on the visdom webpage, and when pressing a download button you have a popup message where you can choose some settings for generating the plot with matplotlib and downloading a high quality image. You could try to infer most data (xmintick, xmaxtick, ...) from the user opts or from plotly (if the plotly API allows for that).
The only issue I can see with this would be that plotly supports a plot-type that matplotlib cannot or vice-versa...
By explicitly separating backends in the implementation, we make it clear that we we treat all visualization backends equally and more backends can be added (one could imagine adding backends for d3.js, etc. as well). To make for a good user experience, we can still add a button in each plot window that lets you switch between backends after the plot was created.
What you're describing could be construed as a way to circumvent plotly licensing, so we want to stay far away from that.
Yeah I was wondering if it would be against plotly's license... :clown_face:
Well, supporting multiple backends would surely be a nice addition!
In the meantime I might still create a small tool to parse the json files and generate matplotlib plots with it.
I'll post it here if I have anything worthy of sharing! :construction_worker_man:
Just chiming in here to request support for an easy way to export csv's of plots. I was thinking of just a download button to download csv's of all plots in the env. I generate quite some data that I'd like to be able to clean up some more before the final plot.
@Phantomb I feel like such a feature would be useful, though you should open it as a separate feature request as it is not directly related to Matplotlib and might get buried here.
@JackUrb You are completely correct! I kind of accidentally glossed over that as a I came here from a search how to best save the data. Will do, thanks!
Hi @Phantomb do you feel #272 covers your use case? You can extract all the data from an environment using it and then parse the content however you see fit.
Just wrote this up the other day to save CSV files from a visdom instance: https://github.com/jramapuram/visdom_to_csv
It's super simple, but might be useful to folks. Thanks @JackUrb for the API!