I have a UIAxes plot that populates with the data selected from the checklist on the left. However when the data is selected, the plot takes a 3d view. Is there a way to intialize the UI as a 2d plot, or make sure that the camera is only showing the 2d view?

8 件のコメント

Adam Danz
Adam Danz 2022 年 3 月 28 日
What plot commands are you using?
Ethan Brueckner
Ethan Brueckner 2022 年 3 月 29 日
編集済み: Adam Danz 2022 年 3 月 29 日
cla(app.UIAxes)
hold(app.UIAxes,'on')
daspect(app.UIAxes,'auto')
app.UIAxes.XGrid = 'on';
app.UIAxes.YGrid = 'on';
app.UIAxes.Box = 'on';
app.UIAxes.Position = [44 57 501 409];
for i = 1:24
if app.selectedDataPlot1(i) % where app.selectedDataPlot is a vector of booleans
plot(app.UIAxes,app.xdata,app.plotData.matrix(:,i)') % Where app.plotData.matrix is a matrix of all data to be
% plotted
end
end
Adam Danz
Adam Danz 2022 年 3 月 29 日
編集済み: Adam Danz 2022 年 3 月 30 日
If that's the only thing happening, I don't see why the axis view would become 3D unless it's 3D to begin with.
To switch to 2D,
view(app.UIAxes, 2)
Ethan Brueckner
Ethan Brueckner 2022 年 3 月 29 日
This is the plot that shows when I add the data to the plot
Adam Danz
Adam Danz 2022 年 3 月 30 日
All I see is a black image with a white square. What should we be seeing?
Ethan Brueckner
Ethan Brueckner 2022 年 3 月 30 日
The image above shows the graph after data is selected. Porblem is that the graph is 3D, I have to rotate it to get just the x and y axis as this is showing mostly the X and Z axis. This is after using the view(UIAxes,2) as well. Not only this but when the graph populates the graph becomes tiny or moves around the gui depending on what data is selected
Ethan Brueckner
Ethan Brueckner 2022 年 3 月 30 日
Managed to solve it by setting y limits! Thanks for the help!
Adam Danz
Adam Danz 2022 年 3 月 30 日
Sounds like some serious bugs. If you think it's within the Matlab software, please contact technical support.

サインインしてコメントする。

 採用された回答

Kevin Holly
Kevin Holly 2022 年 3 月 29 日

0 投票

Without knowing what you are plotting, all I can recommend is changing to a 2D view. You can do so as shown below. Note, in App Designer you need to specify the uiaxes in these functions.
figure
scatter3(rand(10),rand(10),rand(10),'.')
view(0,0)
figure
plot3(rand(10),rand(10),rand(10))
view(0,90)
figure
scatter3(rand(10),rand(10),rand(10),'filled')
view(90,90)
figure
surf(rand(10),rand(10),rand(10))
view(90,0)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

製品

リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by