Scatter3 with changing colors and markertype along axes

1 view (last 30 days)
Caroline on 5 Feb 2020
Edited: KSSV on 5 Feb 2020
I would like to generate scatter3 so that the colors change after the X axis and the type of markers after the Y axis. Z is neutral, it doesn't need a change. I tried to change colors based on other forum posts, but it didn't bring positive results for me. For the answer whether it is possible to change markertype I didn't find any information.
Scateer3 without changing colors work - image.
Here is my code, in the download data attachment
Thank you for any answers!
colors = [0.450, 0.419, 0.980; % Initialize colors - one row per color.
0.305, 0.270, 0.890;
0.098, 0.058, 0.760;
0.207, 0.184, 0.596;
0.086, 0.066, 0.435]
% Replicate each row 5 times.
KolorMap = repelem(colors, 5, 1);
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
set(gcf, 'Name', 'XXX', 'NumberTitle', 'On')
%Data Import
Z = daneMeanAll(:,1).';
X = daneMeanAll(:,4).';
Y = daneMeanAll(:,5).';
Y2 = daneMeanAll(:,8).';
subplot (1,2,1)
s1 = scatter3(X, Y, Z, KolorMap);
xlabel('{\it a} [°]','FontSize',10); ylabel('{\it v} [-]','FontSize',10); zlabel('{\it X} [mN]','FontSize',10);
subplot (1,2,2)
s2 = scatter3(X, Y2, Z, KolorMap);
xlabel('{\it a} [°]','FontSize',10); ylabel('{\it v} [-]','FontSize',10); zlabel('{\it X} [mN]','FontSize',10);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!