In [1]:
from ggplot import *
%matplotlib inline
In [4]:
ggplot(mtcars, aes(x='wt', y='mpg')) + geom_point() + geom_hline(y=25)
Out[4]:
In [5]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
geom_point() + \
geom_hline(y=[10, 35])
Out[5]:
In [9]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
geom_point() + \
geom_hline(y=[10, 35], color='BurlyWood')
Out[9]:
In [12]:
ggplot(mtcars, aes(x='wt', y='mpg')) + \
geom_point() + \
geom_hline(y=range(10, 40, 5), color='seagreen')
Out[12]:
In [15]:
ggplot(diamonds, aes(x='price')) + \
geom_histogram() + \
geom_hline(y=10000, color='salmon') + \
facet_wrap('cut')
Out[15]:
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]:
In [ ]: