Fork me on GitHub

ggplot from ŷhat


scale_x_reverse

Usage

scale_x_reverse(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

# regular
ggplot(aes(x='price'), data=diamonds) +\
    geom_histogram()
# reversed
ggplot(aes(x='price'), data=diamonds) +\
    geom_histogram() +\
    scale_x_reverse()
ggplot(aes(x='carat', y='price'), data=diamonds) +\
    geom_point() +\
    scale_x_reverse()