• Remix
  • Share
  • New Entry

  • Hans Scharler

  • /
  • How do I add different colors in scatter3 plot?

on 12 Oct 2021
  • 2
  • 100
  • 1
  • 0
  • 121
% How can I add different colors in scatter3 plot
% https://www.reddit.com/r/matlab/comments/q3xy5n/how_can_i_add_different_colors_in_scatter3_plot/
%
% Requires R2021b
%
% ColorVariable can be passed in to set the color
% https://www.mathworks.com/help/matlab/ref/scatter3.html#btr5_il-1
tbl = readtable('patients.xls');
s = scatter3(tbl,'Systolic','Diastolic','Weight','filled', ...
'ColorVariable','Diastolic');
Image
Remix Tree