Scatter multiple table rows above same X-axis value
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a table with 5 columns. How can I for each column, scatter all contents above same X-axis value corresponding to that column?

댓글 수: 0
답변 (1개)
Star Strider
2022년 8월 24일
Try this —
M = [1859 25.7 25.4; 1860 25.7 23.6; 1861 24.9 26.3];
figure
scatter(M(:,1), M(:,[2 3]), 'filled')
grid
xlim(xlim+[-1 1])
Make appropriate changes to get the result you want.
.
댓글 수: 4
Star Strider
2022년 8월 24일
I no longer have access to R2018b. It may only want a pair of vectors at a time.
Perhaps this instead —
M = [1859 25.7 25.4; 1860 25.7 23.6; 1861 24.9 26.3];
figure
hold on
for k = 1:size(M,2)-1
scatter(M(:,1), M(:,k+1), 'filled')
end
hold off
grid
xlim(xlim+[-1 1])
.
참고 항목
카테고리
Help Center 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

