How do you have 2 different colors in a bar graph ggplot in where one color for the negatives and positives

0 votes
Oct 2, 2020 in Data Analytics by Andris
• 120 points
1,114 views

1 answer to this question.

0 votes

Hi@Andris,

Once you have the data, you can make the graph and map pos to the fill color. Notice that you use position=“identity” with the bars. This will prevent a warning message about stacking not being well defined for negative numbers.

answered Oct 5, 2020 by MD
• 95,460 points

Related Questions In Data Analytics

0 votes
1 answer

R language has several packages for solving a problem. How do you make a decision on which one is the best to use?

CRAN package ecosystem has more than 6000 ...READ MORE

answered Jun 5, 2018 in Data Analytics by zombie
• 3,790 points
1,166 views
0 votes
0 answers

how to hide and show legends for different geom_plots* in a single ggplot?

how to hide and show legends for ...READ MORE

Jul 23, 2019 in Data Analytics by karthick
863 views
+1 vote
2 answers
0 votes
1 answer

How to order bars in a bar graph using ggplot2?

The key to ordering is to set ...READ MORE

answered Jun 1, 2018 in Data Analytics by DataKing99
• 8,250 points
1,207 views
0 votes
1 answer

How will you define the number of clusters in a clustering algorithm?

Though the Clustering Algorithm is not specified, ...READ MORE

answered Aug 21, 2018 in Data Analytics by Abhi
• 3,720 points
2,082 views
0 votes
1 answer

Which package is used to do data import in R and Python and How do you import SAS data?

We can do data import using multiple ...READ MORE

answered Aug 24, 2018 in Data Analytics by Abhi
• 3,720 points
949 views
0 votes
2 answers

How do you build a custom function in Python?

Function arguments in Python In Python, Custom functions ...READ MORE

answered Sep 4, 2018 in Data Analytics by shams
• 3,670 points
1,456 views
0 votes
1 answer
+1 vote
2 answers

change the color for bars in geom_bar in ggplot

Hi @radha, You can have 2 types of ...READ MORE

answered Jul 24, 2019 in Data Analytics by Cherukuri
• 33,030 points
35,820 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP