R Change ggplot scatterplot colors
up vote
0
down vote
favorite
I'm an R newbie and have searched for the answer to this to no avail.
I have a simple ggplot scatterplot that I set the color to "cluster" of which there are 3. The plot comes out great and is colored in 3 shades of blue. I want the colors to be dark blue, orange, and green. How do I do this? I've been toying with scale_color_manual and cannot get anything to work.
Cheers
Jeff
ggplot2
add a comment |
up vote
0
down vote
favorite
I'm an R newbie and have searched for the answer to this to no avail.
I have a simple ggplot scatterplot that I set the color to "cluster" of which there are 3. The plot comes out great and is colored in 3 shades of blue. I want the colors to be dark blue, orange, and green. How do I do this? I've been toying with scale_color_manual and cannot get anything to work.
Cheers
Jeff
ggplot2
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm an R newbie and have searched for the answer to this to no avail.
I have a simple ggplot scatterplot that I set the color to "cluster" of which there are 3. The plot comes out great and is colored in 3 shades of blue. I want the colors to be dark blue, orange, and green. How do I do this? I've been toying with scale_color_manual and cannot get anything to work.
Cheers
Jeff
ggplot2
I'm an R newbie and have searched for the answer to this to no avail.
I have a simple ggplot scatterplot that I set the color to "cluster" of which there are 3. The plot comes out great and is colored in 3 shades of blue. I want the colors to be dark blue, orange, and green. How do I do this? I've been toying with scale_color_manual and cannot get anything to work.
Cheers
Jeff
ggplot2
ggplot2
asked Nov 21 at 22:43
Jeff M
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Possibly cluster is a numeric variable, then ggplot uses scale_color_continuous. Try converting "cluster" to character or to factor and then try scale_color_manual
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Possibly cluster is a numeric variable, then ggplot uses scale_color_continuous. Try converting "cluster" to character or to factor and then try scale_color_manual
add a comment |
up vote
0
down vote
accepted
Possibly cluster is a numeric variable, then ggplot uses scale_color_continuous. Try converting "cluster" to character or to factor and then try scale_color_manual
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Possibly cluster is a numeric variable, then ggplot uses scale_color_continuous. Try converting "cluster" to character or to factor and then try scale_color_manual
Possibly cluster is a numeric variable, then ggplot uses scale_color_continuous. Try converting "cluster" to character or to factor and then try scale_color_manual
answered Nov 21 at 22:49
Erich Neuwirth
18115
18115
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421457%2fr-change-ggplot-scatterplot-colors%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown