I have what I need now, thank you. WHP
#This one working ggplot(tbl, aes(x = Month_Yr, y = value, fill = variable, label = value)) + geom_bar(stat = "identity") + geom_text(size = 3, position = position_stack(vjust = 0.5)) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5)) + labs(title = "Plot Example") -----Original Message----- From: Bill Poling Sent: Thursday, May 30, 2019 11:49 AM To: r-help (r-help@r-project.org) <r-help@r-project.org> Cc: Bill Poling <bill.pol...@zelis.com> Subject: Help with staked bar plot values Version 2 Hello #RStudio Version 1.2.1335 sessionInfo() # R version 3.6.0 Patched (2019-05-19 r76539) # Platform: x86_64-w64-mingw32/x64 (64-bit) # Running under: Windows 10 x64 (build 17134) I am still trying to get this stacked bar plot with values incereted in the bars to work. str(df3) 'data.frame':12 obs. of 4 variables: $ Month_Yr : chr "2018-01" "2018-02" "2018-03" "2018-04" ... $ CurrentBilledAccepted: num 50612538 52140848 75341460 75733565 78990033 ... $ CurrentBilled : num 166049599 152054677 211204320 193905607 215781328 ... $ TotalBilled : num 281806122 258607481 345235833 331032520 379911877 ... dput(df3) structure(list(Month_Yr = c("2018-01", "2018-02", "2018-03", "2018-04", "2018-05", "2018-06", "2018-07", "2018-08", "2018-09", "2018-10", "2018-11", "2018-12"), CurrentBilledAccepted = c(50612538.37, 52140847.86, 75341460.14, 75733565.33, 78990032.7, 75709569.66, 90937537.58, 88087064.92, 77733110.21, 121863059.73, 118697983.95, 122725876.36), CurrentBilled = c(166049599.06, 152054677.36, 211204320.27, 193905606.94, 215781328.14, 219237895.09, 262944323.08, 238565431.51, 205345173.62, 290686847.52, 273146859.13, 300757011.52 ), TotalBilled = c(281806122.24, 258607481.1, 345235832.56, 331032519.52, 379911877.36, 392791354.13, 425577554.8, 412169215.64, 359511992.21, 507625318.05, 463895541.75, 515639239.79)), class = "data.frame", row.names = c(NA, -12L)) This simple version works: df3 <- df2[,c(1,4,3,2)]#Reorder the column positions tbl<-melt(df3,id.vars="Month_Yr") ggplot(tbl,aes(x=Month_Yr,y=value,fill=variable))+geom_bar(stat='identity') #When I go to add values to the plot it worked earlier this AM. Then I reopened RStudio and ran everything up to this point without error and got to this and re-ran and it does not work #Add values to the plot bars #https://stackoverflow.com/questions/6644997/showing-data-values-on-stacked-bar-chart-in-ggplot2 tbl<-melt(df3,id.vars="Month_Yr") str(tbl) p <- qplot(Month_Yr, variable, data = tbl, geom = "bar", fill = variable, theme_set(theme_bw())) p1 <- p + geom_text(aes(label = value), size = 3, hjust = 0.5, vjust = 3, position = "stack") + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5)) + labs(title = "Plot Example") p1 The error is: Don't know how to automatically pick scale for object of type function. Defaulting to continuous. Error: All columns in a tibble must be 1d or 2d objects: * Column `label` is function I have no idea what that means? Can someone help please? Thank you. WHP Confidentiality Notice This message is sent from Zelis. ...{{dropped:13}} ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.