how do you plot a 2D scatter with colour defined by 3rd variable in given limits?
이전 댓글 표시
I am happy plotting 2d scatters but i want to colour in my 2 variables (temperature and fugacityco2) according to the day of the year (julian day). I found that if the 3rd variable is the same length as the x and y variables it will plot it over the given color range given, which has worked. BUT i want to be able to set it so that for different periods eg days 0-50 it is red 'r', 50-100,blue etc etc. help would be GREATLY appreciated thanks!
My code is below
% scatter of points figure (5);
scatter(temperature,fugacityco2_recomputed,1,julian_day);
colorbar;
axis([-2.3 -1.75 100 1000]);
xlabel('temperature');
ylabel('fugacity_co2');
답변 (1개)
Image Analyst
2012년 11월 23일
1 개 추천
Why don't you just pass in the colors as the 4th argument to scatter()?
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!