2013-08-30 34 views

回答

1

是的。如果使用rpy2.robjects.lib.ggplot2手動映射,它是目前從那裏失蹤,但修補這種方式應該是:

import rpy2.robjects.lib.ggplot2 as ggplot2 

class ThemeClassic(ggplot2.Theme): 
    _constructor = ggplot2.ggplot2.theme_classic 
    @classmethod 
    def new(cls): 
     res = cls(cls._constructor()) 
     return res 

# Monkey patching ggplot2 
ggplot2.theme_classic = ThemeClassic.new 
+0

的偉大工程的感謝!你碰巧有什麼想法http://stackoverflow.com/questions/17736434/aligning-distinct-non-facet-plots-in-ggplot2-using-rpy2-in-python?未解決的問題 – user248237dfsf