harrelfe / Hmisc

Harrell Miscellaneous
Other
205 stars 81 forks source link

Error bars in xYplot don't respect logarithmic axis setting #94

Open tamas-ferenci opened 6 years ago

tamas-ferenci commented 6 years ago

Here is a minimal reproducible example:

 SimData <- data.frame( x = runif( 100 ), y = runif( 100 )*100+10 )
 SimData$lwr <- SimData$y-10
 SimData$upr <- SimData$y+10

 xYplot( Cbind( y, lwr, upr )~x, data = SimData )
 xYplot( Cbind( y, lwr, upr )~x, data = SimData, scales = list( y = list( log = 10 ) ) )

It seems that error bars are not rescaled (but the points are) with the logarithmic scaling, so the whole thing gets inconsistent.

The quite straightforward xYplot( Cbind( y, log10( lwr ), log10( upr ) )~x, data = SimData, scales = list( y = list( log = 10 ) ) ) solution seems to work, so this is really not a high-priority issue, but perhaps it'd nicer if this'd be automatic.