Reputation: 11
I am trying to make two plots in the same figure using function truehist. How to put boxplot function into truehist histogram and visualize both together?
box <- ggplot(n_walmart.csv,aes(x=TotalWages),color = "Yellow",ylab ="Wages")
boxplot <- box + geom_boxplot() + coord_flip()
truehist(n_walmart.csv$TotalWages,nbins=20,prob = TRUE,col = 5,
xlab = "Magnitude",
ylab = "Frequency")
Upvotes: 1
Views: 1459
Reputation: 414
If you want create two plot side-by-side, you can use par()
function with mfrow
parameter. like below :
par(mfrow = c(1,2))
That code generate a hidden window with one row and two columns.
Upvotes: 2