From ligges at statistik.uni-dortmund.de  Thu Aug 26 17:02:01 2004
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Thu Aug 26 17:01:20 2004
Subject: [Rd] mtext adj= wrong with several las= (PR#7188)
In-Reply-To: <20040826144246.29ED810460@slim.kubism.ku.dk>
References: <20040826144246.29ED810460@slim.kubism.ku.dk>
Message-ID: <412DFB69.9000503@statistik.uni-dortmund.de>

joehl@gmx.de wrote:
> 
> Hi Uwe,
> 
> Thanks for your mail.
> 
> I see it different: yes, Left / right adjustemnt seems to be perfectly OK.
> But at axis 1 with las=1, it's not Left / right adjustement what is needed
> here. Here the text needs to be right adjusted, and the (one) adj= par
> should determine the vertical alignment. 

I don't think so. Things are perfectly clear for the user if adj 
controls adjustment in reading direction independently from the las 
setting - and a second value specifying perpendicular adjustment.


 > It is a bit confusing, but for
> mtext, the distance to the axis is done via line= and adj= moves ALONG the
> axis, whatever las= says. 

No, adj moves not always along the axis:

plot(1:10)
mtext("Hello", 3, at=5, adj=0, col="red")
mtext("Hello", 3, at=5, adj=1, col="green")
mtext("Hello", 3, at=5, adj=0, col="red", las = 2)
mtext("Hello", 3, at=5, adj=1, col="green", las = 2)


> I agree that it would be more flexible and logical to also have the 2
> element form of adj=c(horizontal, vertical) here, but I fear that this
> creates a lot of incompatibilities with existing code and with S+.

My suggestion was different: using a new argument padj to be more flexible.

Uwe Ligges


> Best
> 
> 
> Jens
> 
> 
> 
>>Left / right adjustemnt seems to be perfectly OK.
>>The thing that matters is centering "several lines" to the specified 
>>("at=") location.
>>In fact, mtext() is not centering but bottom-aligning by adding a 
>>negative distance that looks OK for one line in the default font size, 
>>but not in most other cases.
>>
>>Hence this is the same as Paul Murrell's PR#1659 ("mtext() alignment of 
>>perpendicular text"). Fixing this, and/or improving mtext()'s "adj" 
>>argument to accept 2 dimensions is desirable, but might be not that 
>>easy... I'll take a look during the next days, but nothing promised.
> 
> 
> --
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] mtext adj= wrong with several las= (PR#7188)
Uwe Ligges