Be default, the labels on the plot are represented without sign in a barplot that is created by using ggplot2 but we might want to display the sign of the labels especially in cases where we have some negative values. This can be done with the help of geom_text function of ggplot2 package as shown in the below example.
Consider the below data frame −
x<-c("A","B","C","D") y<-c(21,-5,-20,10) df<-data.frame(x,y) df
x y 1 A 21 2 B -5 3 C -20 4 D 10
Loading ggplot2 package and creating bar chart for data in df −
Creating bar chart for data in df with negative labels displayed with negative sign −