0

Hi I am trying to created a logi.hist.plot using the package popbio but the second y-axis label seems to be encroaching on the axis ticks. Here is the code I am using:

 molters
 logiplot<-logi.hist.plot(elevations,molters,boxp=FALSE,type="hist",col="gray",xlab="Elevation (Km)",scale.hist=3,intervalo=.1,ylabel="Probability of Molting",ylabel2="Frequency of Molting Wilson's warbler",counts=F)

I really just need to move the second y-axis label right a bit. Any help is much appreciated.

1 Answers1

3

You can use mtext to place text in your margins.

library(popbio)

## example from ?logi.hist.plot
data(aq.trans)
aq.trans$survived<-aq.trans$fate!="dead"
a<-subset(aq.trans, leaf<50 & stage!="recruit", c(leaf,survived))
logi.hist.plot(a$leaf,  a$survived, 
               type="hist", boxp=FALSE, counts=TRUE, int=10, 
               ylabel="Survival probability", ylabel2="",  # blank the label
               xlab="Number of leaves" )

## Adjust right label
ylabel2 <- "Number of plants"
mtext(ylabel2, 4, col="red")           # initial
mtext(ylabel2, 4, padj=1, col="blue")  # move right (could also use 'line' argument)

enter image description here

Rorschach
  • 31,301
  • 5
  • 78
  • 129