Created
January 23, 2017 10:59
-
-
Save NickWoodhams/8ecf32ff58f94a849b279ce51218de96 to your computer and use it in GitHub Desktop.
Generate scatterplot with 2 different colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data =xlsread('data.xlsx'); | |
vec1 = data (:,1); | |
vec2 = data (:,2); | |
mean_vec1 = mean(vec1) | |
hold on | |
find(vec1); | |
find(vec2); | |
hold on; | |
for i=1:length(vec1) | |
if vec1(i) > mean_vec1 | |
scatter(vec1(i), vec2(i), 'blue', 'filled') | |
else | |
scatter(vec1(i), vec2(i), 'red', 'filled') | |
end | |
end | |
xlabel('Vec1') | |
ylabel('Vec2') | |
hold off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment