yhat / ggpy

ggplot port for python

Home Page:http://yhat.github.io/ggpy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

boxplot from statistics

edoardovivo opened this issue · comments

Hello,
I am trying to produce a boxplot given the values of the percentiles of the data instead of the data itself.
According to this page this is possible in R (towards the end of the page):

http://ggplot2.tidyverse.org/reference/geom_boxplot.html

However, this doesn't seem to work in Python, producing

ggplot(df_test, aes(x="Cluster")) + geom_boxplot(aes(ymin = "mn", lower = "p25", 
                                                 middle = "p50", upper = "p75", ymax = "mx"),
   stat = "identity")

.local/lib/python2.7/site-packages/ggplot/ggplot.pyc in __repr__(self)
    114 
    115     def __repr__(self):
--> 116         self.make()
    117         # this is nice for dev but not the best for "real"
    118         if os.environ.get("GGPLOT_DEV"):

/home/evivo/.local/lib/python2.7/site-packages/ggplot/ggplot.pyc in make(self)
    634                         if kwargs==False:
    635                             continue
--> 636                         layer.plot(ax, facetgroup, self._aes, **kwargs)
    637 
    638             self.apply_limits()

/home/evivo/.local/lib/python2.7/site-packages/ggplot/geoms/geom_boxplot.pyc in plot(self, ax, data, _aes, x_levels)
     31         variables = _aes.data
     32         x = data[variables['x']]
---> 33         y = data[variables['y']]
     34 
     35         xticks = []

KeyError: 'y'

from which it is clear that he's expecting a "y" variable.

I am using ggplot 0.11.5.

Am I doing something wrong? Is this going to be implemented any time? Any workaround?

Thanks a lot
Edoardo