a7024416e4ff05722bc2bcee0c2771933899dfe3,ggplot/geoms/geom_area.py,geom_area,plot_layer,#geom_area#Any#Any#,10

Before Change


    VALID_AES = ["x", "ymin", "ymax", "color", "alpha", "label"]

    def plot_layer(self, layer, ax):
        layer = dict((k, v) for k, v in layer.items() if k in self.VALID_AES)
        layer.update(self.manual_aes)
        x = layer.pop("x")
        y1 = layer.pop("ymin")
        y2 = layer.pop("ymax")
        ax.fill_between(x, y1, y2, **layer)

After Change


    VALID_AES = ["x", "ymin", "ymax", "color", "alpha", "label"]

    def plot_layer(self, data, ax):
        groups = {"color", "alpha"}
        groups = groups & set(data.columns)
        if groups:
            for name, _data in data.groupby(list(groups)):
                _data = _data.to_dict("list")
                for ae in groups:
                    _data[ae] = _data[ae][0]
                self._plot(_data, ax)
        else:
            _data = data.to_dict("list")
            self._plot(_data, ax)

    def _plot(self, layer, ax):
        layer = dict((k, v) for k, v in layer.items() if k in self.VALID_AES)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: has2k1/plotnine
Commit Name: a7024416e4ff05722bc2bcee0c2771933899dfe3
Time: 2014-03-30
Author: has2k1@gmail.com
File Name: ggplot/geoms/geom_area.py
Class Name: geom_area
Method Name: plot_layer


Project Name: has2k1/plotnine
Commit Name: 51696521c68b6a1b9af2e05eee4df944981daf5a
Time: 2014-03-30
Author: has2k1@gmail.com
File Name: ggplot/geoms/geom.py
Class Name: geom
Method Name: plot_layer


Project Name: probcomp/bayeslite
Commit Name: eeec3413dd672bd4838c83b131586f7e7b5c254d
Time: 2015-06-04
Author: riastradh+probcomp@csail.mit.edu
File Name: src/crosscat.py
Class Name: CrosscatMetamodel
Method Name: _crosscat_get_rows