Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Commit 644b0c0

Browse files
committed
resolves issue #580
1 parent b6d23c2 commit 644b0c0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

ggplot/geoms/geom_ribbon.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .geom import geom
22
from ..utils import is_date
33
import numpy as np
4+
from ..ggplot import ggplot
45

56
class geom_ribbon(geom):
67
"""
@@ -35,6 +36,21 @@ class geom_ribbon(geom):
3536
DEFAULT_PARAMS = {}
3637

3738
_aes_renames = {'linetype': 'linestyle', 'size': 'linewidth', 'fill': 'facecolor', 'color': 'edgecolor'}
39+
40+
41+
def __radd__(self, gg):
42+
if isinstance(gg, ggplot):
43+
gg.layers += self.layers
44+
if self.geom_aes is not None:
45+
for aes_key in ['fill', ]:
46+
if aes_key in self.geom_aes:
47+
gg._aes[aes_key] = self.geom_aes.pop(aes_key)
48+
return gg
49+
50+
self.layers.append(gg)
51+
return self
52+
53+
3854
def plot(self, ax, data, _aes):
3955
(data, _aes) = self._update_data(data, _aes)
4056
params = self._get_plot_args(data, _aes)

0 commit comments

Comments
 (0)