Faisal Moledina wrote:
> Laurent,
> 
> On Sun, Nov 29, 2009 at 4:13 AM, Laurent Gautier <lgaut...@gmail.com> wrote:
>> That's more an issue with ggplot2 than with rpy2.
>> What I meant earlier is the following:
>>
>> pp += ggplot2.geom_line(ggplot2.aes_string(x='z',y='dens'),
>>                        data=datafline)
>>
>>
>> It is working here (rpy2-2.1dev -- note: your code revealed a bug with
>> rpy2.robjects, so you might need a very recent update from the repository).
> 
> That seem to have been the issue.

May be not. The bug I am referring was an unfortunate infinite recursion 
during robjects-level object mapping.
The error messages you reported suggest more that the aes must be the 
first (unnamed) argument to a geom_* function (which the code above shows).

> By upgrading to the most recent
> update in the repository, I have been able to plot both the histogram
> and the line, each from a different dataset. As a side note, it
> appears that ggplot2.aes_string is now ggplot2.aes, which is the way
> it is in R.

The other way around.
rpy2's ggplot.aes used to in fact call R's ggplot2::aes_string. It first 
seemed like a good idea but made some call impossible (and this changed 
at least 2 months ago, I think)

> Next problem: Because I included the option y='..density..' in my
> histogram aes, my plot now has ..density.. as its x label. This
> doesn't happen in R. I thought I could rectify this by adding the line
> pp=pp+ggplot2.opts(xlab="z"), but that doesn't seem to work. If I
> remove the option y='..density..' from my histogram aes, I get z as my
> x label, but I still cannot change it using the options (e.g.
> pp=pp+ggplot2.opts(xlab="z position") has no effect). Any thoughts?

This is a gpplot2 question, not an rpy2 one, I think (which I can't be 
all answering in good conscience when there is both documentation on the 
ggplot2 website, as well as a recent book available).

 From memory, the call should be pp = pp + ggplot2.scale_x_continous("z 
position")


L.


> Faisal


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to