error with changing color of marker using scatter3
3 ビュー (過去 30 日間)
古いコメントを表示
I want to create a 3D scatter plot using different colors for each marker, which is information contained in rgb. I keep getting errors, and I can't figure out what is going on!
I checked that the dimensions of Table are 50x4 and that rgb is 50x3 with numbers only 0-1. I tried a test using this "colorvector" and that also did not work, so I don't think it is something to do with the file.
Table = readtable(DataFilePath);
Map = [Table.Var2/360, Table.Var3/100, Table.Var4/100];
rgb = hsv2rgb(Map);
%Colorvector= repmat([0,1,1],height(Table),1);
scatter3(Table,"Var2", "Var3", "Var4", 15, rgb);
It generates the scatter of just Table and the variables with no other modifications , but I can't get any color modifications to work. The error message is "Error using scatter3 (line 57) Invalid parameter/value pair arguments. Error in ScatterplotAttempt1 (line 16) , scatter3(Table,"Var2", "Var3", "Var4",15, rgb );"
0 件のコメント
回答 (1 件)
Star Strider
2022 年 1 月 21 日
This is the best I cand o.
Table = table(rand(10,1),rand(10,1),rand(10,1),rand(10,1))
Map = [Table.Var2/360, Table.Var3/100, Table.Var4/100];
rgb = hsv2rgb(Map);
%Colorvector= repmat([0,1,1],height(Table),1);
figure
hs3 = scatter3(Table, 'Var2', 'Var3', 'Var4','filled', 'ColorVariable','Var4');
hs3.SizeData = 15;
colormap(rgb)
colorbar
..
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!