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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -