def merge(self, other):
"""
Merge overlapped guides
For example::
from ggplot import *
gg = ggplot(aes(x='cut', fill='cut', color='cut'), data=diamonds)
gg + stat_bin()
This would create similar guides for fill and color where only
a single guide would do
"""
self.key = pd.merge(self.key, other.key)
duplicated = set(self.override_aes) & set(other.override_aes)
if duplicated:
warn("Duplicated override_aes is ignored.")
self.override_aes.update(other.override_aes)
for ae in duplicated:
self.override_aes.pop(ae)
return self
评论列表
文章目录