I am using an orphaned R library (wmtsa). One of it’s functions creates a continuous wavelet transform (wavCWT()) that returns a wavelet object and it can be plotted by calling the traditional plot() function. Unfortunately, the way the function is written does not allow me to change some typical plot parameters. In particular, I cannot set axes=F and I am forced to have the axes plotted all the time. This is not helpful as I want to add extra layers to my device and the axes are different and it they are offset.
Is there a way to pass the argument to the method that is calling the plot() function?
If this is not possible I am afraid I will have to modify the source code. If this is the case, where should I look in order to modify the methods of this kind of object?
I found the source of the methods but my hacking skills are limited and I am a bit lost.
Example:
library(wmtsa) # assuming you have installed the package wmtsa
wavCWT(sin(rnorm(1000)))
plot(W, power.stretch=0.5)
produces this plot:

but if I try to remove axes with axes=F I get the following message:
plot(W, power.stretch=0.5, axes=F)
Error in plot.default(NA, NA, xlim = xlim, ylim = ylim, type = "n", xaxs = xaxs, :
formal argument "axes" matched by multiple actual arguments
You do need to change the source, but only very slightly. On line 269-270 of
wav_xform.R, inside theplot.wavCMTfunction change the line:to
The reason is that ellipsis (
...)- that means “take any extra arguments to theplotfunction and pass them to theimagefunction”. However, the original code hadaxes=TRUEthere too, which means that if you try and passaxes=FALSEyou’ll get aformal argument "axes" matched by multiple actual argumentserror.Then (once you reinstall), the following works to get rid of the axes:
Also note that you can change other common plot parameters, thanks to that ellipsis! (That’s true even if you never modify the source). For example: