How to add legend in a 3D scatter plot?
13 次查看(过去 30 天)
显示 更早的评论
I have following piece of code. I am using tsne visualization to plot 3D scatter plot. But I am unable to find a way to add legends.
clear all; clc; close all;
load('trLabels.mat')
load('trFeatures.mat')
X = trSets;
L = labels;
rng default % for fair comparison
Y3 = tsne(X,'Algorithm','barneshut','NumPCAComponents',20,'NumDimensions',3);
figure
scatter3(Y3(:,1),Y3(:,2),Y3(:,3),15,L,'filled', '');
colormap( jet(numel(unique(L))) )
0 个评论
回答(1 个)
madhan ravi
2020-7-5
legend(' :) ')
5 个评论
madhan ravi
2020-7-5
编辑:madhan ravi
2020-7-5
Can’t help without looking at your file, I would see 11 calls to scatter3() or a loop whereas you have only one ? and you expect 11 entries?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!