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

Add matplotlib as a backend #126

Closed
dberenbaum opened this issue Apr 4, 2023 · 5 comments
Closed

Add matplotlib as a backend #126

dberenbaum opened this issue Apr 4, 2023 · 5 comments

Comments

@dberenbaum
Copy link
Contributor

Using https://mpld3.github.io/, it might be possible to have dvc plot matplotlib figures in HTML. This would be useful for both users who are accustomed to making plots in matplotlib but also for other backend libraries that use it for plotting, like shap.

@daavoo
Copy link
Contributor

daavoo commented Apr 4, 2023

Note that, like #7, the main "problem" is not the implementation on dvc/dvc-render side (which is fairly simple), but supporting it in the VSCode and Studio UIs.

@dberenbaum
Copy link
Contributor Author

Maybe it's simpler if they are halfway between how we handle vega plots and images. The don't have to be defined by data and properties but could be an entire plot saved to a file where VS Code and Studio only need to know to render it with mpld3 or other backend.

@daavoo
Copy link
Contributor

daavoo commented Apr 4, 2023

Maybe it's simpler if they are halfway between how we handle vega plots and images.

It is simpler but still work to do on the UIs.

dvc/dvc-render can be shipped in (probably) 1-2 days, but was never done as it was not a priority and would be blocked by the UI support (IMO, didn't make sense to ship without UI support).

The don't have to be defined by data and properties but could be an entire plot saved to a file where VS Code and Studio only need to know to render it with mpld3 or other backend.

It is a good compromise if it saves significant work for the UIs and we think that "interactive image" provides enough value for users.

For the SHAP example, it looks like would be ok as the plots look like were not made for including data from more than 1 revision.

I can think of other cases where treating the plot as an image instead of aggregating data would feel a little awkward, though.

@dberenbaum
Copy link
Contributor Author

I can think of other cases where treating the plot as an image instead of aggregating data would feel a little awkward, though.

Do you have in mind anything where it would be useful to define as data+properties but it's also important to use a matplotlib/plotly/non-vega backend?

@dberenbaum
Copy link
Contributor Author

Looks like the project linked above has no activity this year ☹️. Closing this one.

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