In [1]:
from ggplot import *
%matplotlib inline

In [2]:
pigeons.head()


Out[2]:
pos breeder pigeon name color sex ent arrival speed to_win eligible
0 1 Texas Outlaws 19633-AU15-FOYS NaN BCWF H 1 42:14.0 172.155 0:00:00 Yes
1 2 Junior Juanich 0402-AU15-JRL NaN SIWF H 1 47:36.0 163.569 0:05:21 Yes
2 3 Jerry Allensworth 0404-AU15-VITA Perch Potato BB H 1 47:41.0 163.442 0:05:27 Yes
3 4 Alias-Alias 2013-AU15-ALIA NaN BBSP H 1 47:43.0 163.392 0:05:28 Yes
4 5 Greg Glazier 5749-AU15-SLI NaN BC H 1 47:44.0 163.366 0:05:30 Yes

In [3]:
ggplot(pigeons, aes(x='pos', y='speed')) + \
    geom_point() + \
    geom_abline()


Out[3]:
<ggplot: (270769573)>

In [4]:
ggplot(pigeons, aes(x='pos', y='speed')) + \
    geom_point() + \
    geom_abline(slope=-1)


Out[4]:
<ggplot: (288455725)>

In [5]:
ggplot(pigeons, aes(x='pos', y='speed')) + \
    geom_point() + \
    geom_abline(slope=(180.-80.)/(-100-400), color='DodgerBlue')


Out[5]:
<ggplot: (288638093)>

In [6]:
ggplot(pigeons, aes(x='pos', y='speed')) + \
    geom_point() + \
    geom_abline(slope=(180.-80.)/(-100-400), intercept=170, color='DodgerBlue')


Out[6]:
<ggplot: (288400217)>

In [7]:
ggplot(mtcars, aes(x='wt', y='mpg', color='factor(cyl)')) + \
    geom_point() + \
    geom_abline(slope=-8, intercept=45)


Out[7]:
<ggplot: (288841533)>

In [8]:
ggplot(diamonds, aes(x='carat', y='price')) + geom_point()


Out[8]:
<ggplot: (288938657)>

In [9]:
ggplot(diamonds, aes(x='carat', y='price')) + \
    geom_point(color='PapayaWhip') + \
    geom_abline(slope=5000)


Out[9]:
<ggplot: (289090901)>

In [10]:
ggplot(diamonds, aes(x='carat', y='price')) + \
    geom_point(color='PeachPuff') + \
    geom_abline(slope=5000, color='OliveDrab') + \
    geom_abline(slope=6000, color='Tomato') + \
    geom_abline(slope=7000, color='SaddleBrown')


Out[10]:
<ggplot: (293507313)>

In [ ]: