[R] zoom graphics

Christoph Scherber Christoph.Scherber at uni-jena.de
Wed Mar 3 15:24:22 CET 2004


Interactive Plots with zoom options etc. can be performed using the 
"iplots" library. It´s really very useful and can be downloaded from

http://stats.math.uni-augsburg.de/iPlots/index.shtml

Best regards
Chris

Barry Rowlingson wrote:

> solares at unsl.edu.ar wrote:
>
>> Hi, i don't understand how i cant zoom in and zoom out a graphics 
>> (plots)
>> exist a package for that? Thanks Ruben
>>
>
>  I dont think you can do it quite like you can zoom in and out in a 
> program like 'photoshop'. All you can really do is redraw the plot 
> with a different set of X and Y limits.
>
> Example:
>
> # some data
>  xy=list(x=rnorm(100),y=rnorm(100))
>
> # default plot shows all the data:
>  plot(xy)
>
> # define an interactive 'zoom' function:
> zoom=function(){reg=locator(2);plot(reg,type='n')}
>
> # click two points at the corners of the zoom region:
> zoom()
>
> # add the points - dont use 'plot' since this resets the axes:
> points(xy)
>
>  If you've got a complex plot with lots of things on it, then yes, you 
> have to redraw it all again, but then you probably should have put 
> that complex plot into a single function!
>
> Barry
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list