How to provide color to ggplot scatter chart depending on field value?

0 votes

How to provide color to ggplot scatter chart depending on field value?

I tried below code but i want different colors and not in the same blue scale. What to do?

ggplot(mpg, aes(cty,hwy,col= km$cluster)) + geom_point()
Jul 16 in Data Analytics by anonymous
17 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Analytics

0 votes
1 answer

How to add labels on bars in bar chart in ggplot?

Use geom_text() to add labels on the ...READ MORE

answered Aug 20 in Data Analytics by anonymous
• 28,360 points
26 views
0 votes
1 answer

How to replace a value in a data frame based on a conditional 'If' statement?

It's easier to convert alpha to characters ...READ MORE

answered Jun 6, 2018 in Data Analytics by darklord
• 6,170 points
87 views
0 votes
1 answer

How to provide xpath value for web scraping?

Hey Karthik, XPath uses path expressions to select ...READ MORE

answered Sep 18 in Data Analytics by anonymous
• 28,360 points
19 views
0 votes
1 answer
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
546 views
0 votes
1 answer

How to change font size of text and axes on R plots ?

To change the font size of text, ...READ MORE

answered Apr 20, 2018 in Data Analytics by zombie
• 3,690 points
75 views
0 votes
0 answers

How to edit the labels and limit if a plot using ggplot? - R

How to edit the labels and limit ...READ MORE

Jul 15 in Data Analytics by piyush
14 views
0 votes
0 answers

which to use fill or color to show colors in R plots?

which to use fill or color to ...READ MORE

Jul 22 in Data Analytics by deepa
18 views
0 votes
0 answers

plot a line chart along with point labels in the plot

Can someone help me to plot a ...READ MORE

Jul 22 in Data Analytics by lokesh
18 views
0 votes
0 answers

Add custom lines/sentences within ggplot

Hi, i have added multiple ggplots in ...READ MORE

Jul 22 in Data Analytics by roopa
15 views