Skip to content

Conversation

@dalloliogm
Copy link

@dalloliogm dalloliogm commented Apr 22, 2025

Hi,
Thanks for developing this library, it is awesome!

This PR adds support for ... arguments to some of the plotting functions. This allows to supply additional parameters to the plots, like fill, color, alpha, size, etc.

For example:

> plot_boxplot(iris, alpha=0.3, by="Species", size=1, fill=Species)

This will pot boxplots as per the normal plot_boxplot function, but it will also pass the size and fill argument to the plotting function.

Why this change?

I like to compare train and test datasets, to see if they have similar distributions. So I frequently do something like this:

> train_test = bind_rows (
    train %>% mutate(dataset="train"),   
    test %>% mutate(dataset="test")
    )

> plot_histogram(train_test, fill=dataset, alpha=0.5)

By passing additional arguments to the plotting functions, I can visualize train and test in the same plot, and compare their distribution.

I've also added a test file, which simply checks whether the functions return error. Happy to add more tests if needed.

@dalloliogm
Copy link
Author

Note: this PR may also fix #181 , as it allows using parameters such as fill, color, to the ggplot.

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.

1 participant