scatter plot with color dependent on variable
40 次查看(过去 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!