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

interactive figures and user input commands #57

Open
jabadge opened this issue Aug 22, 2023 · 5 comments
Open

interactive figures and user input commands #57

jabadge opened this issue Aug 22, 2023 · 5 comments

Comments

@jabadge
Copy link

jabadge commented Aug 22, 2023

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!

@prabhakk-mw
Copy link
Member

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!

@QibangLiu
Copy link

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.

@tylerlekang
Copy link

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?)

@rsp34
Copy link

rsp34 commented Apr 25, 2024

@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.

@tylerlekang
Copy link

tylerlekang commented Apr 25, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants