[R] SVYPLOT

David Winsemius dwinsemius at comcast.net
Thu Nov 20 22:04:05 CET 2014


On Nov 20, 2014, at 12:56 PM, David Winsemius wrote:

> 
> On Nov 20, 2014, at 8:10 AM, Anthony Damico wrote:
> 
>> survey:::svyplot.default   with style="grayhex"   calls
>> hexbin:::gplot.hexbin
>> 
>> an internet search turns up lots of people asking the question "how do i
>> set xlim and ylim on hexbin plots?" but i don't see any easy solutions.  :/
> 
> Looking at the code, which calls hexViewport and then at the help page for hexbin::hexViewport I see that function provides:
> 
> xbnds, ybnds	
> bounds for x- and y- plotting range; these default to the corresponding slots of x.
> 
> ... but I do not see that there is any ellipsis provision for passing those arguments via `hexbin::gplot.hexbin`. Perhaps a bit of hacking could provide such?

Or  perhaps svyplot.default (and cousins) could hacked to accept an argument for xlim and ylim that would then create the proper slots (xbnds and ybnds) in the S4 object it passes? Looks as though some of the argument "expectations" of hexbin plotting functions is via slots and perhaps the ellipsis mechanism would not be needed.

-- 
David.

> 
> -- 
> David.
> 
>> 
>> On Thu, Nov 20, 2014 at 10:31 AM, Raphael Fraser <raphael.fraser at gmail.com>
>> wrote:
>> 
>>> Does not work when ,style="grayhex".
>>> 
>>> library(survey)
>>> data(api)
>>> dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat,
>>> fpc=~fpc)
>>> svyplot(api00~api99, design=dstrat, style="grayhex")
>>> svyplot(api00~api99, design=dstrat, style="grayhex", ylim=c(500, 700))
>>> 
>>> On Thu, Nov 20, 2014 at 9:19 AM, Adams, Jean <jvadams at usgs.gov> wrote:
>>> 
>>>> Raphael
>>>> 
>>>> I just ran an example from the help file, and the xlim argument worked
>>>> fine.  Can you post a small example where the xlim argument doesn't work?
>>>> 
>>>> Jean
>>>> 
>>>> library(survey)
>>>> data(api)
>>>> dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat,
>>>> fpc=~fpc)
>>>> svyplot(api00~api99, design=dstrat, style="bubble")
>>>> svyplot(api00~api99, design=dstrat, style="bubble", xlim=c(500, 700))
>>>> 
>>>> 
>>>> On Thu, Nov 20, 2014 at 12:54 AM, Raphael Fraser <
>>> raphael.fraser at gmail.com
>>>>> wrote:
>>>> 
>>>>> How do I set the limits of my x and y axis in svyplot? xlim and ylim
>>> does
>>>>> not work.
>>>>> 
>>>>> Regards,
>>>>> Raphael
>>>>> 
>>>>>       [[alternative HTML version deleted]]
>>>>> snipped

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list