Fork me on GitHub

ggplot from ŷhat


geom_line

Usage

geom_line(position = 'jitter')

Arguments

Name Description
position Position adjustments to points. jitter
stat The statistical transformation to use on the data for this layer. identity

Aesthetics

ggplot(mtcars, aes('wt', 'mpg')) + \
    geom_line()
ggplot(mtcars, aes('wt', 'mpg', 'qsec')) + \
    geom_line()
ggplot(mtcars, aes(x='wt', y='mpg', size='qsec')) + \
    geom_line()
ggplot(mtcars, aes(x='wt', y='mpg', color='qsec')) + \
    geom_line() +\
    scale_colour_gradient(low="coral", high="steelblue")
ggplot(mtcars, aes(x='wt', y='mpg')) + \
    geom_line(color='steelblue', size=100)
ggplot(mtcars, aes(x='wt', y='mpg')) +\
    geom_line(colour="black", size = 100) +\
    geom_line(colour="pink", size = 40)
ggplot(mtcars, aes(x='wt', y='mpg')) + \
    geom_line(color='steelblue', size=100, alpha=0.4)
ggplot(diamonds, aes(x='carat', y='price', color='color')) +\
    geom_line(alpha=0.1)
ggplot(meat, aes(x='date', y='beef')) +\
    geom_line()
ggplot(pd.melt(meat, id_vars=['date']), aes(x='date', y='value', color='variable')) +\
    geom_line()
ggplot(pd.melt(meat, id_vars=['date']), aes(x='date', y='value', color='variable')) +\
    geom_line()
movies.rating = movies.rating.round(0)
movies_by_year = movies.groupby(["year", "rating"]).apply(len).reset_index()
movies_by_year.columns = ['year', 'rating', 'number']
ggplot(movies_by_year, aes(x='year', y='number', color='rating')) +\
    geom_line()
ggplot(movies_by_year, aes(x='year', y='number', color='factor(rating)')) +\
    geom_line()