Borrar filtros
Borrar filtros

3D Plot not Rotating

11 visualizaciones (últimos 30 días)
Felipe Dicker
Felipe Dicker el 27 de Abr. de 2024
Respondida: Yatharth el 29 de Abr. de 2024
I have a 3D plot in App Designer and I would like the user to be able to rotate it freely using the mouse. However this is not working, even with the rotate tool selected in the figure. I also tried the rotate3d 'on' command, but it also does not seem to work. Is this a bug? Can I fix it within the code somehow?

Respuestas (1)

Yatharth
Yatharth el 29 de Abr. de 2024
Hi Felipe,
I understand you're experiencing difficulties with freely rotating a 3D plot in App Designer. I couldn't replicate this issue in MATLAB R2023a. Could you please specify your MATLAB version?
Additionally, please ensure you're utilizing the "rotate3d" function for rotation capabilities. For more details on "rotate3d," visit:https://www.mathworks.com/help/matlab/ref/matlab.graphics.interaction.internal.rotate3d.html
Below is my code snippet for a button callback that creates a random 3D plot on UI Axes, allowing user rotation:
function GeneratePlotButtonPushed(app, event)
[X, Y] = meshgrid(-3:.1:3);
Z = peaks(X, Y); % Using peaks function for demonstration; you can replace it with random data
% Plot the data
surf(app.UIAxes, X, Y, Z);
% Enhance the 3D visualization
app.UIAxes.XLabel.String = 'X-axis';
app.UIAxes.YLabel.String = 'Y-axis';
app.UIAxes.ZLabel.String = 'Z-axis';
% Enable rotation
rotate3d(app.UIAxes, 'on');
end
I hope this helps resolve your query.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by