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
262 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,220 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 4, 2018 in Data Analytics by zombie
• 3,790 points
293 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
142 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,240 points
539 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
554 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
206 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 3, 2018 in Data Analytics by shams
• 3,660 points
264 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
• 32,970 points
23,940 views
0 votes
1 answer