On Sep 11, 2012, at 7:48 AM, Gabor Grothendieck wrote:

> On Wed, Sep 5, 2012 at 11:06 AM, Nicolai Schneider
> <rstatistics.u...@gmail.com> wrote:
>> Hello everyone,
>> 
>> a problem with the plot.zoo function. In the parameters of the function,
>> cex.lab is ignored. I tried to reduce the size of the yaxis labels by at
>> least 50%.
>> 
>> ------------------
>> 
>> Example:
>> 
>> sample <- as.zoo(EuStockMarkets)
>> 
>> par(las=1)
>> 
>> plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date",
>> yaxt="n", cex.lab=0.5, xaxs="i")
>> # Try playing with different values for cex.lab
>> 
>> par(las=0)
>> 
> 
> Internally it uses mtext to write that text and mtext uses cex which
> is already taken.  Here is a workaround:
> 
> library(proto)
> p <- proto(plot.zoo = plot.zoo, mtext = function(...)
> graphics::mtext(..., cex = .5))
> with(p, plot.zoo)(sample)
So that creates an R environment where you are creating an unmodified instance 
of the plot.zoo function as well as installing a genetically-modified instance 
of mtext which has a redefinition of the parameter list to graphics::mtext()? 
(So using `(... , arg=newval)` is an acceptable way to over-rule a parameter 
list assignment? It certainly seems to be.) 

So when you access access that p-instance of plot.zoo(), it finds this new 
"genetically-modified" instance of mtext() because it is in the same 
environment?

And the reason it doesn't work to just redefine mtext (I tried) is that it 
would be in an environment that plot.zoo would not examine first when called 
from the command line?

-- 

David Winsemius, MD
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to