How to set color gradient based on z axis?
31 views (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!