Skip to content

Conversation

frareb
Copy link

@frareb frareb commented Mar 26, 2020

Hi,
This is a minor modification to the barplot2 function to sort/order bars within a column while keeping the colors. Thanks for your feedback and I hope it will be of general interest. You can test it with :
set.seed(1234)
dataset <- matrix(sample(1:20, 104/2, replace = TRUE), ncol = 13)
myCol <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A")
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13])
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13], order = TRUE, decr = TRUE)
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13], order = TRUE, decr = FALSE)

Copy link
Member

@warnes warnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. Can you update the manual page in man/barplot2.Rd to include the new arguments and add your example?

@frareb
Copy link
Author

frareb commented Mar 30, 2020

I updated the manual page in man/barplot2.Rd. Thanks

@frareb frareb requested a review from warnes July 3, 2020 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants