endangeredoxen / fivecentplots

A Python plotting analgesic
https://endangeredoxen.github.io/fivecentplots
11 stars 6 forks source link

Add 'Live Mode' Plot Panel #50

Closed denver-lloyd closed 1 year ago

denver-lloyd commented 1 year ago

Hi Steve,

Having a look at the source code and I think it would be fairly (optimistic here) straightforward to create a custom panel that allows grouping keywords (legend, row, col, wrap, etc.) to be selectable based on the columns in the DataFrame being plotted. The idea here is that when live mode is enabled the user is able to dynamically update the grouping of the plots.

I think this would be a very useful feature from say a GUI where plots are being generated but the user does not have the ability to easily update the plot keywords.

I am planning on creating a branch and begin working on this, but I wouldn't to run it by you and get your input prior to kicking off.

Thanks, Denver

denver-lloyd commented 1 year ago

A few additional comments:

  1. When live mode is enabled create a plot panel that contains the plot from the currently selected plotting engine and an additional fcp custom panel
  2. Expose the data columns to be selectable by the user for various keywords of interest (legend, row, col, wrap, engine)
  3. Ability to dynamically update the plot from said plotting window

Thanks, Denver

denver-lloyd commented 1 year ago

Looking a bit closer I think it may make more sense to create a new plot engine, something like 'bokeh _live' that renders locally in the browser and has the ability to perform the above operations (extending to more should be straight forward too). This would probably be the cleanest and most efficient approach.

Embedding the plot in a new window would work best with Qt I think, but then Qt becomes a dependency of fcp and that isn't great. Alternatively could make it work with tkinter, but I suspect this would be really slow compared to a browser based solution with Bokeh and would only be straightforward to implement with the mpl engine.