plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
15.67k stars 2.51k forks source link

Add figure composition with overloading operator #1482

Open mazzma12 opened 5 years ago

mazzma12 commented 5 years ago

Hi,

I found really useful overloading operators + and * to compose figure objects, as inspired in the holoview library Have you ever considered this feature ?

jonmmease commented 5 years ago

Hi @mazzma12,

Yes, I like this approach a lot. I actually implemented the subplotting logic for the HoloViews plotly backend. It's implemented as the figure_grid function in https://github.com/pyviz/holoviews/blob/master/holoviews/plotting/plotly/util.py.

Holoviews only supports a subset of plotly's constructs, so this implementation isn't sufficient for inclusion in plotly.py directly, but it would be a good starting point.

Also for reference, any new subplotting features are going to need to take into account the coming integration of plotly_express and it's plot faceting support.

mazzma12 commented 5 years ago

Hi @jonmmease

Interesting to see that there is a plotly backend for HV, I'll give it a try.

Holoviews only supports a subset of plotly's constructs, so this implementation isn't sufficient for inclusion in plotly.py directly, but it would be a good starting point.

Can't you support it for a few simple structures s.a Scatter and let it fails with NotImplementedError Otherwise (or maybe I don't see the big picture)

Also for reference, any new subplotting features are going to need to take into account the coming integration of plotly_express and it's plot faceting support.

I understand, actually, I hesitated reporting the request there but thought it was better to start it in the initial project.

LukasKnsp commented 2 years ago

It's 2022 and this feature still would be super useful!