When using barplot with add y2 axis for lines or points by par(new=TRUE) as show in the example code usually get shifted.
The updateusr method from Greg Snow's TeachingDemos package is a great solution for this problem. The idea behind updateusr is define new plot region according to the ratio of one unit in each axis.
The code:
Example code:(add space 8/20)
Result:
1 則留言:
張貼留言