Fork me on GitHub

ggplot from ŷhat


scale_x_date

Usage

scale_x_date(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='date', y='beef'), data=meat) +\
    geom_point() +\
    scale_x_date()
ggplot(aes(x='date', y='beef'), data=meat) +\
    geom_point() +\
    scale_x_date(labels = date_format("%Y-%m-%d"))
ggplot(meat, aes('date','beef')) + \
    geom_line() + \
    scale_x_date(labels = date_format("%Y-%m-%d"), breaks='10 years')