Scatter 3D Plot with Varying Colors

11 ビュー (過去 30 日間)
Philip
Philip 2018 年 9 月 17 日
コメント済み: Philip 2018 年 9 月 17 日
I need my Scatter plot to be color scaled: I've only had limited success with Scatter3(inputs), no luck with dot commands.
30x3 Matrix of Data
[ 1 2 0]
[ 2 3 9]
...
I tried creating a color scale as directed in help function, only the edge color changed.
c = [ 0 0 .1]
[ 0 0 .2]
...
Scatter3(,,,c) Doesn't work as directed.
Dot notation and paired variables only accepts scalar...
h = scatter3(x,y,z,100,'filled');
h.Marker = 'o';
h.MarkerEdgeColor = 'k'; //Won't take a matrix

採用された回答

Steven Lord
Steven Lord 2018 年 9 月 17 日
When I modified the "Vary Marker Color" example from the scatter3 documentation page to add the 'filled' option to the scatter3 call, it worked as I expected.
If you show the code you wrote where you tried to create a color scale, we may be able to offer some guidance about why it didn't work as you expected and how to correct it.
  1 件のコメント
Philip
Philip 2018 年 9 月 17 日
You are correct sir, adding 'filled' solved the issue.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by