In [1]:
from ggplot import *
%matplotlib inline
In [4]:
ggplot(mtcars, aes(x='wt', y='mpg')) + geom_point() + geom_hline(y=25)
Out[4]:
<ggplot: (288250901)>
In [5]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
    geom_point() + \
    geom_hline(y=[10, 35])
Out[5]:
<ggplot: (288532565)>
In [9]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
    geom_point() + \
    geom_hline(y=[10, 35], color='BurlyWood')
Out[9]:
<ggplot: (290365021)>
In [12]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
    geom_point() + \
    geom_hline(y=range(10, 40, 5), color='seagreen')
Out[12]:
<ggplot: (293595221)>
In [15]:
ggplot(diamonds, aes(x='price')) + \
    geom_histogram() + \
    geom_hline(y=10000, color='salmon') + \
    facet_wrap('cut')
Out[15]:
<ggplot: (296287009)>
In [20]:
ggplot(diamonds, aes(x='carat', y='price')) + \
    geom_point(alpha=1/100.) + \
    geom_hline(y=15000, color='Orchid') + \
    geom_vline(x=2, color='Orchid')
Out[20]:
<ggplot: (299586333)>
In [ ]: