jupyter-matlab-proxy icon indicating copy to clipboard operation
jupyter-matlab-proxy copied to clipboard

interactive figures and user input commands

Open jabadge opened this issue 10 months ago • 5 comments

I was very excited to find this tool, thank you!

It would be very useful, however, if the figures were interactive and if it allowed user input commands like ginput. Are there plans to incorporate either or both of these? I know the latter was mentioned in the limitations readme.

If I'm missing something or if anyone has found a good workaround for either of these, I'd appreciate any information.

Thanks!

jabadge avatar Aug 22 '23 17:08 jabadge

Thank you @jabadge for your suggestions!

Unfortunately the current version of the MATLAB Kernel only supports static content, and it does sound like a reasonable next step to extend support to interactive figures.

Could you please help us understand your requirements from this future feature:

  1. Do you expect the figures and inputs commands to be interactive only when connected to a MATLAB session?
  2. How would you expect these cells and their outputs to behave when you share the notebook with another user who may not have MATLAB available ?
  3. Do you expect them to have the same level of interactive behavior as you did when you created the notebook with MATLAB running in the background?
  4. Is there an equivalent MATLAB live script or Python notebook that you could share with us that has the features that you are looking to have available through the MATLAB Kernel for Jupyter?

We look forward to your thoughts and suggestions!

prabhakk-mw avatar Sep 05 '23 07:09 prabhakk-mw

Hello, it would be great if we could interact with the figures as we do with the Matlab desktop app, such as zooming in and out, and using the cursor to get the point value from the figure.

QibangLiu avatar Oct 11 '23 14:10 QibangLiu

Another nice request here. The following might be more difficult or impossible to do in the Matlab environment, but in Python Notebooks I believe there is a setting or magic like %matplotlib qt (that was a while ago, but I assume something similar is still possible). So if it were possible to have figures pop open in new windows and be displayed as if called from regular Matlab, which are very powerful plotting tools, that could be very helpful.

Even more ideal then would be a flow like this:

  • get your code working for what you want
  • call the figures/plotting as desired
  • the window pops open
  • user then adjusts the figure position/size, zoom, etc. etc. as they want, in the window
  • an option exists like "Save Current View in Notebook" which would then basically copy the figure and "paste" a static picture of it into the notebook (which I think roughly is what happens now when you do inline plotting in Notebooks?)

tylerlekang avatar Dec 22 '23 15:12 tylerlekang

@jabadge, @QibangLiu, @tylerlekang, please try initialising figures with figure(visible="on"). I find that I get the plot in the notebook but the MATLAB figure window also pops up.

rsp34 avatar Apr 25 '24 08:04 rsp34

@rsp34 good idea! This worked to have a separate matlab window open with the figure:

image

I can also still interact with the open figure:

image

In the notebook it appears to capture whatever is sent to the new figure immediately.

EDIT: the figure window also continues to lives on, even if I shut down the kernel and close the jupyter server.

The "would be nice to have" is the ability to manipulate the figure views in the open figure window, and have the ability to save/replace the saved image in the notebook with whatever is showing in the figure.

Thanks!

tylerlekang avatar Apr 25 '24 13:04 tylerlekang