File:Geom bar simple.png: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

13 August 2024

  • curprev 15:4715:47, 13 August 2024Brb talk contribs 418 bytes +418 <syntaxhighlight lang='r'> library(ggplot2) data <- data.frame( category = c("A", "B", "C", "D"), value = c(3, 5, 2, 8) ) ggplot(data, aes(x = category, y = value, fill = category)) + geom_bar(stat = "identity") + coord_flip() + labs(x = "Category", y = "Value") + # scale_fill_manual(values = c("A" = "red", "B" = "blue", "C" = "green", "D" = "purple")) theme_minimal() </syntaxhighlight>