Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine more than one plot #223

Open
vim15 opened this issue Sep 13, 2022 · 0 comments
Open

Combine more than one plot #223

vim15 opened this issue Sep 13, 2022 · 0 comments

Comments

@vim15
Copy link

vim15 commented Sep 13, 2022

hello,

This is a feature request.
I was wondering if there is any scope to add more than two types of plots together. Like geom_bar() and geom_line(), in a single plot.

For example, if you have the below data frame named 'cost' :

structure(list(Date = structure(c(18686, 18686, 18714, 18714, 18745, 18745), class = "Date"), Utility = c("Gas", "Electricity", "Gas", "Electricity", "Gas", "Electricity"), usage = c(0, 0, 125, 208, 104, 232), price = c(0, 0, 45.46, 37.82, 39.67, 43.09 )), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame" ))

be able to plot something like this in esquisse :

ggplot(cost) + geom_bar(aes(x = Date, fill = Utility, weight = usage)) + geom_line(aes(x = Date, y = price, colour = Utility), size = 0.5) + scale_fill_hue(direction = 1) + scale_color_manual( values = c(Electricity = "#8E0152", Gas = "#276419") ) + theme_minimal()

I think it would be a nifty feature which at the moment is missing.

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

No branches or pull requests

1 participant