Skip to content
Prev 13430 / 63421 Next

mtext adj= wrong with several las= (PR#7188)

ligges@statistik.uni-dortmund.de wrote:

            
Having looked into the code, there are three possible solution (all with
some drawbacks) I can see. Well, the current argument "adj" becomes
"xadj" in the C sources (graphics.c, GMtext), and "yadj" is set to 0. 
Hence the ugly hard coded LineBias of 0.3.


Solutions
=========
1: Hardcode "yadj" to 0.5 and remove all those 0.3 biases. Looks good 
for axes, but it might break some code --> bad.
On the other hand, GMMathText has hardcoded yadj=0.5. Is there a problem 
with some special devices? Or any other reason not to center stuff using 
"adj=0.5"?

2: Allow the typical 2-value adj, take the first as xadj, the second one
as yadj. This might break some code, because currently adj of
arbitrary length (!=0) is allowed and recycled.

3: Invent an argument "padj" for mtext() that represents adjustment
*p*erpendicular to the text direction and gets mapped to "yadj" in
GMtext. In that case the hardcoded 0.3 bias mentioned above can be
removed. The question is whether to set the default to 0.5 (will still
break code, but easily to fix by setting padj to 0).

I'd like to propose the third solution and would be happy to provide a
patch of GMText, including corresponding patches to GMMathText, as well 
as mtext(), title() and axis() (and their inderlying do_* components).

Are there any objections? Any reasons not to do it?

Uwe Ligges