scatter plot with color dependent on variable
35 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How can I plot my data from the same group according to the color bar? (same group will be same colour)
1 Kommentar
Image Analyst
am 12 Jun. 2022
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Antworten (1)
Image Analyst
am 11 Jun. 2022
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 Kommentare
Image Analyst
am 31 Aug. 2022
@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:
Siehe auch
Kategorien
Mehr zu Scatter Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!