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 in Data Analytics by Andris
• 120 points
149 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 by MD
• 78,910 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,770 points
182 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
92 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,210 points
451 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
313 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
130 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,630 points
163 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to access the last value from a vector in R?

Hi@akhtar, You can use the tail function in ...READ MORE

answered Oct 30 in Data Analytics by MD
• 78,910 points
11 views