r - Labelling issue after using gap.plot to create an axis break -


i've been struggling plot shows data accurately, , spent while getting gap.plot , running. after doing so, have issue labelling points.

just plotting data ends this:

plot of abundance data, 2 different tiers of data @ ~38,000, , between 1 - 50

as can see, doesn't show either top or bottom sections of plots enough distinguish anything.

using gap plot, managed get:

gap.plot of abundance data, 100 - 37000 missed, labels appearing on lower tier

the code 2 plots pretty simple:

plot(counts.abund1,pch=".",main= "repeat 1") text(counts.abund1, labels=row.names(counts.abund1), cex= 1.5)  gap.plot(counts.abund1[,1],counts.abund1[,2],gap=c(100,38000),gap.axis="y",xlim=c(0,60),ylim=c(0,39000)) text(counts.abund1, labels=row.names(counts.abund1), cex= 1.5) 

but don't know why/can't figure out why labels (which letters points denote) not being applied same in 2 plots.

i'm kind of out of depth trying bit, little idea how plot things nicely, never had data when learning.

the data comes large (10,000 x 10,000 matrix) contains random assortment of letters z, has replacements , "speciation" or "immigration" results in first lot of letters @ ~38,000, , second lot below 50.

the code run after getting matrix rank abundance is:

##abundance 1 counts1 <- as.data.frame(as.list(table(neutral.v1))) counts.abund1<-rankabundance(counts1) 

with neutral.v1 being matrix.

the data frame counts.abund1 looks (extremely poorly formatted, sorry):

rank    abundance   proportion  plower  pupper  accumfreq   logabun rankfreq        1   38795   3.9 nan nan 3.9 4.6 1.9 x   2   38759   3.9 nan nan 7.8 4.6 3.8 j   3   38649   3.9 nan nan 11.6    4.6 5.7 m   4   38639   3.9 nan nan 15.5    4.6 7.5 

and continues variables. use rank , abundance right now, a,x,j,m variable applies to, , want use labels on plot.

any advice appreciated. can't shorten code or provide matrix because type of data quite specific, quantities in sense.

as mentioned, i've been using gap.plot create break in axis, if there better solutions plotting type of data i'd absolutely ears.

really sorry mess of question, bit frazzled on whole thing right now.

gap.plot() doesn't draw 2 plots 1 plot decreasing upper section's value, drawing additional box , rewriting axis tick labels. so, upper region's y-coordinate neither equivalent original value nor axis tick labels. real y-coordinate in upper region "original value" - diff(gap).

gap.plot(counts.abund1[,1], counts.abund1[,2], gap=c(100,38000), gap.axis="y",           xlim=c(0,60), ylim=c(0,39000)) text(counts.abund1, labels=row.names(counts.abund1), cex= 1.5) text(counts.abund1[,1], counts.abund1[,2] - diff(c(100, 38000)), labels=row.names(counts.abund1), cex=1.5)  # example data used set.seed(1) counts.abund1 <- data.frame(rank = 1:50,                              abundance = c(rnorm(25, 38500, 100), rnorm(25, 30, 20))) 

enter image description here


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -