scatter plot with color dependent on variable
조회 수: 23 (최근 30일)
이전 댓글 표시
How can I plot my data from the same group according to the color bar? (same group will be same colour)
댓글 수: 1
Image Analyst
2022년 6월 12일
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
답변 (1개)
Image Analyst
2022년 6월 11일
Try this:
x = 1:10;
y = 51:60;
cmap = turbo(length(y))
scatter(x, y, 200, cmap, 'filled')
grid on;
colormap(cmap)
colorbar
caxis([min(y), max(y)])
댓글 수: 4
Image Analyst
2022년 8월 31일
@Astthor Gislason that's too bad, but you didn't give us your code. I ran the code again and it gave me exactly the plot I had posted. You must have changed the code somehow.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
