Fork me on GitHub

ggplot from ŷhat


scale_x_continuous

Usage

scale_x_continuous(name = ..., breaks = ..., labels = ..., limits = ...)

Arguments

Name Description
name Label for x axis.
breaks Points at which x gridlines appear.
labels Labels for x ticks.
limits Where x axis starts/stops.

Examples

ggplot(aes(x='carat', y='price'), data=diamonds) +\
    geom_point() +\
    scale_x_continuous(limit=(0,1))
ggplot(aes(x='carat', y='price'), data=diamonds) +\
    geom_point() +\
    scale_y_continuous(limits=(0,20000)) +\
    scale_x_continuous(name="size in carats", limits=(0,5))
ggplot(aes(x='carat', y='price'), data=diamonds) +\
    geom_point() +\
    scale_y_continuous(limits=(10000,15000)) +\
    scale_x_continuous(name="size in carats", limits=(2,3))