Skip to content
Prev 394418 / 398500 Next

plot level, velocity, acceleration with one x axis

On 5/30/23 10:23 AM, Eric Berger wrote:
Most of the space is consumed with two extraneous copies of the axis. 
  We can get around that with three calls to par:


op <- par(mfrow=c(3,1), mar=c(0, 4.1, 4.1, 2.1))
plot(DAX.[, 1], log='y', ylab='DAX')
par(mar=c(0, 4.1, 0, 2.1))
plot(DAX.[, 2], ylab='vel (%)')
par(mar=c(5.1, 4.1, 0, 2.1))
plot(DAX.[, 3], ylab='accel (%)')
par(op)


	  However, the three panels are NOT equal in size:  roughly 30% vs. 44% 
vs. 26%.  I can get closer using layout, but if I change the aspect 
ratio, it changes the relationship between the heights of the three 
panels.


	  That's the problem I'm trying to solve.  It's also why it makes sense 
to me to modify plot.ts to accept a vector for the log argument, with 
the constraint that length(lot) = either 1 or ncol(x).


	  There may be a way to do it using gglot2 / the tidyverse, but I'm not 
facile with that, and my web searches have so far failed to produce 
anything better than modifying plot.ts.R (and then submitting such with 
compatible changes to plot.ts.Rd), as I suggested earlier.


	  ???
	  Thanks,
	  Spencer