scatter3 makes a 2D plot

39 ビュー (過去 30 日間)
Cynthia Dickerson
Cynthia Dickerson 2016 年 8 月 19 日
コメント済み: KenoKanawa 2019 年 9 月 13 日
I'm trying to plot the contents of a cell array (RSD_c{v}) composed of 5 32x3 double matrices. I used the following code:
figure;hold on;
cellfun( @(x) scatter3( x(:,3), x(:,4), x(:,5) ), RSD_c );
title('Relationship Between Relative Standard Deviation, Bootstrap Replicates, and Dimension')
xlabel('Bootstrap Replicates') % x-axis label
ylabel('Relative Standard Deviation') % y-axis label
zlabel('Dimensions') % z-axis label
When the graph is plotted, it makes a 2D chart. Tracing the points shows that they have x, y, and z coordinates. However, the graph is 2-dimensional, with the points color-coded by z-coordinate.
Does anybody know how to fix this?

採用された回答

Steven Lord
Steven Lord 2016 年 8 月 20 日
You used hold before calling scatter3. When you turn hold on, it basically "freezes" the properties of the axes from being automatically modified (by functions like scatter3, for example.) If no axes exists when you call hold, it creates one in the default 2-D view.
You can create an axes with a 3-D view using the view command then hold it (or vice versa; hold prevents the properties from being automatically modified, but you can explicitly modify them.)
  2 件のコメント
Cynthia Dickerson
Cynthia Dickerson 2016 年 8 月 21 日
That fixes it. Thanks!
KenoKanawa
KenoKanawa 2019 年 9 月 13 日
Thank you

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by