Learn R Programming

bossMaps (version 0.1.0)

asinh_trans: Create an axis transform using the Inverse hyperbolic sine transformation

Description

Create an axis transform using the Inverse hyperbolic sine transformation to allow log-like axis using data with negative values

Usage

asinh_trans()

Arguments

Value

Adds a new transformation for use with ggplot

References

http://wresch.github.io/2013/03/08/asinh-scales-in-ggplot2.html

http://robjhyndman.com/hyndsight/transformations/

http://stackoverflow.com/questions/14504869/histogram-with-negative-logarithmic-scale-in-r

Examples

Run this code
  
 library(ggplot2)
 ggplot(data.frame(x=seq(-1000,1000,len=200)), aes(x=x,y=x))+
 geom_line(size=1)+
 scale_x_continuous(trans = 'asinh',breaks=c(-1000,-100,10,-1,0,1,10,100,1000))

Run the code above in your browser using DataLab