r - How do I make custom scales on a scatter plot in ggplot2? -
I am using a diamond data set to do some analysis for a project. I need to understand how to change X and Y scale. When I use:
Library (ggplot2) ggplot (diamonds, AES (x = carat, y = value)) + geom_point () + ylab ("diamond price") + xlab ("Diamond Cut") The X scale is 0-5 and the y scale is 1000-5000.
Use xlim or ylim : < / P> ggplot (diamonds, aes (x = carat, y = value)) + geom_point () + ylab ("diamond cut") + xlab ("diamond cut") + yelim (0, 5000 ) + Exclamation (0,2)
Comments
Post a Comment