I have the following code that takes a pandas dataframe and creates ggplot object using rpy2. It used to work just fine with rpy2
version 3.4.5
df = pandas.DataFrame({'date': datecol, 'val0': val0, 'val1': val1})
combinedplot = gg2.ggplot(df) + gg2.aes_string(x='date', y='val0')
where gg2
is rpy2
module ggplot2
type of combinedplot
is rpy2.robjects.lib.ggplot2.GGPlot
, and I can display the image of the plot using various ways.
I upgraded to rpy2 3.5.11, and this code snippet no longer works. type of combinedplot
is now a rpy2.robjects.vectors.ListVector
. I’m not sure why, but I’m guessing it has something to do with how rpy2 combines objects.
What exactly is going on here?
If my objective is to create a ggplot object so I can generate an image, how do I do it?