how do you make a scatter plot with categorical data with connecting lines?
이전 댓글 표시
Hello!
I have two 5x34 matrices that I want to compare in a plot like as follows
;
;My code so far is as follows:
%% dot plot
for i = 1:length(subjects)
subj=subjects{i} % individual subject
figure(1)
x = ones(1, length(lh_mean_nocap))
scatter(x, lh_mean_nocap, 'b', 'filled'); hold on
scatter(x, rh_mean_nocap, 'b', 'filled')
set(gcf, 'color', 'w');
hold on;
x = 2 * ones(1, length(lh_mean_nocap));
scatter(x, lh_mean_cap, [], [0.9100 0.4100 .1700], 'filled'); hold on
scatter(x, rh_mean_cap, [], [0.9100 0.4100 .1700], 'filled'); hold on
title('Grey White Matter Mean Signal Ratio - All Subjects');
ax = gca;
ax.XTick = [1,2];
ax.XTickLabels = {'No Cap', 'R-Net'}
ylabel('Grey White Matter Mean Signal')
xlim([0, 3])
end
Which gives me a graph with two categorical parts, however, I want to connect the corresponding categoricalvariables.
thank you!
댓글 수: 1
dpb
2021년 11월 9일
You forgot to attach your data...
You just want a line between the means of each of the sets of scatter points, I guess? Since there's only one point shown on the sketch it's not at all clear what the data sizes are...
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
