In [6]:
from ggplot import *
import pandas as pd

In [3]:
print (ggplot(mtcars, aes('mpg', 'qsec')) + \
  geom_point(colour='steelblue') + \
  scale_x_continuous(breaks=[10,20,30],  \
                     labels=["horrible", "ok", "awesome"]))


<ggplot: (-9223363297789005259)>
/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [5]:
print (ggplot(meat, aes('date','beef')) + \
    geom_line(color='black') + \
    scale_x_date(breaks=date_breaks('7 years'), labels='%b %Y') + \
    scale_y_continuous(labels='comma'))


<ggplot: (-9223363297788986792)>
/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [8]:
meat_lng = pd.melt(meat, id_vars=['date'])

p = ggplot(aes(x='date', y='value'), data=meat_lng)
p + geom_point() + \
    stat_smooth(colour="red") + \
    facet_wrap("variable")

#p + geom_hist() + facet_wrap("color")

p = ggplot(diamonds, aes(x='price'))
p + geom_density() + \
    facet_grid("cut", "clarity")

p = ggplot(diamonds, aes(x='carat', y='price'))
p + geom_point(alpha=0.25) + \
    facet_grid("cut", "clarity")


/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/myke/soft/anaconda3/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj)
    695                 type_pprinters=self.type_printers,
    696                 deferred_pprinters=self.deferred_printers)
--> 697             printer.pretty(obj)
    698             printer.flush()
    699             return stream.getvalue()

/home/myke/soft/anaconda3/lib/python3.5/site-packages/IPython/lib/pretty.py in pretty(self, obj)
    381                             if callable(meth):
    382                                 return meth(obj, self, cycle)
--> 383             return _default_pprint(obj, self, cycle)
    384         finally:
    385             self.end_group()

/home/myke/soft/anaconda3/lib/python3.5/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
    501     if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
    502         # A user-provided repr. Find newlines and replace them with p.break_()
--> 503         _repr_pprint(obj, p, cycle)
    504         return
    505     p.begin_group(1, '<')

/home/myke/soft/anaconda3/lib/python3.5/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
    683     """A pprint that just redirects to the normal repr function."""
    684     # Find newlines and replace them with p.break_()
--> 685     output = repr(obj)
    686     for idx,output_line in enumerate(output.splitlines()):
    687         if idx:

/home/myke/soft/anaconda3/lib/python3.5/site-packages/ggplot/ggplot.py in __repr__(self)
    109     def __repr__(self):
    110         """Print/show the plot"""
--> 111         figure = self.draw()
    112         # We're going to default to making the plot appear when __repr__ is
    113         # called.

/home/myke/soft/anaconda3/lib/python3.5/site-packages/ggplot/ggplot.py in draw(self)
    245                                      ),
    246                                      transform=ax.transAxes,
--> 247                                      fontdict=dict(rotation=-90, verticalalignment="center", horizontalalignment='left')
    248                             )
    249 

/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in text(self, x, y, s, fontdict, withdash, **kwargs)
    614         if fontdict is not None:
    615             t.update(fontdict)
--> 616         t.update(kwargs)
    617 
    618         t.set_clip_path(self.patch)

/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/text.py in update(self, kwargs)
    242         super(Text, self).update(kwargs)
    243         if bbox:
--> 244             self.set_bbox(bbox)  # depends on font properties
    245 
    246     def __getstate__(self):

/home/myke/soft/anaconda3/lib/python3.5/site-packages/matplotlib/text.py in set_bbox(self, rectprops)
    514                                     bbox_transmuter=bbox_transmuter,
    515                                     transform=mtransforms.IdentityTransform(),
--> 516                                     **props)
    517         else:
    518             self._bbox_patch = None

TypeError: __init__() got multiple values for argument 'width'

In [ ]: