How to set color gradient based on z axis?
18 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have this 3d scatter plot wher right now the color gradient is done by default and is being done in order of rows of data in the table, I was wondering if I can do the color gradient based on the z-axis values (like high to low)? Thanks!
hSc3 = scatter3(T.CED(ix),T.r(ix),T.E0(ix),'filled');
xlabel('ln(CED) (Pa)','fontweight','bold');
ylabel('Atomic Radius (pm)','fontweight','bold');
zlabel('E0 (V)','fontweight','bold');
NNZ = nnz(ix);
C = jet(NNZ);
hSc3.CData = C;
%T(ix,:)
hold on % don't let added stuff wipe out what we've already got drawn
hL=plot(nan(2,NNZ),'o');
set(hL,{'MarkerFaceColor'},num2cell(C,2),{'MarkerEdgeColor'},num2cell(C,2));
hLg=legend(hL,T.Element(ix));
0 件のコメント
回答 (1 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!