Effacer les filtres
Effacer les filtres

Switching between axes in GUI

12 vues (au cours des 30 derniers jours)
Christoffer Johansson Westheim
I'm creating a GUI using guide, with two axes. I plot a 3d isosurface in one and use drawline on top of a plot in the second. The issue is that I need to be able to rotate the 3d plot and modify the drawline, but after I make the drawline I can no longer rotate the 3d plot. If I replot the 3d plot I can start rotatting it again, but then I can no longer modify the drawline object. Replotting it does not help.
So, questions is - How can I switch between the axes and continue to rotate the 3d figure and modify the drawline object?

Réponses (2)

Rik
Rik le 17 Jan 2019
With the rotate3d function you can enable and disable this mouse interaction for a specific axis or figure. I presume this will override previous settings.
  1 commentaire
Christoffer Johansson Westheim
I use the rotate3d(axis1) command to initiate being able to rotate the isosurface plot. Problem is that once I have used the drawline in axis2, I can no longer rotate the plot in axis1.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 17 Jan 2019
I'm not sure how you're rotating it (automatically via code, or by the user grabbing it and spinning it), but bascially to switch focus between different axes, use the axes function:
% Now stuff will happen in axes1.
axes(handles.axes1);
plot(1:10); % Whatever....
% Now stuff will happen in axes2.
axes(handles.axes2);
  3 commentaires
Jan
Jan le 17 Jan 2019
@Christoffer: Can you post some code, which reproduces the problem? I'm not sure what "modify a drawline" means.
Christoffer Johansson Westheim
The program is 3000+ lines of code, so I'm not sure I can make something simple to reproduce the problem. I assume something like this would be similar to what I try to do: Use guide to generate a GUI with two axes. In the first use drawline to draw a line (I use a button to activate the function) and then plot a 3d figure in the second axes and used rotate3d(handles.axes2) to allow rotation of the figure. Then try to modify the drawline in the first axes (or if using a button to activate drawline, try to rotate the figure in axes2).
From Matlab:
h = drawline(handles.axes1, ___) begins interactive placement of a linear region of interest (ROI) on the specified axes. The function returns h, a handle to an images.roi.line object. You can modify the ROI interactively using the mouse. The ROI object also supports a context menu that controls aspects of its appearance and behavior.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by