Zoom in and out while using Locator() in R -
i have xy scatter plot of many points define filament structures (imagine looking @ pile of sticks laying on ground, that's these plots like). using locator identify start , end of each filament. end result table of line segments defined 2 points in xy.
a simplified base version of code runs this:
n=1 numberoffilaments=5 xdata=rnorm(1000,mean=500,sd=100) ydata=rnorm(1000,mean=500,sd=100) clicks.table=c() while (n<=numberoffilaments) { plot (xdata,ydata) clicks = locator(2) = c(clicks$x[1],clicks$y[1]) b = c(clicks$x[2],clicks$y[2]) clickpoints = c(a,b) clicks.table = rbind(clicks.table,clickpoints) n=n+1 } some of data sets have gotten quite large in regard total width of data in x & y in comparison length of filaments trying click on. makes hard me accurately click on start , end of filaments. able zoom in on plot view individual filament, click 2 points zoom out view whole pile again. typically use r studio if matters. thank in advance.
Comments
Post a Comment