Skip to content
Prev 445 / 63424 Next

R-alpha: R 0.50.a3: title( .. adj= x) AND mtext( .. adj= x)

Martin Maechler <maechler@stat.math.ethz.ch> writes:
-- as it should be! adj=0 is left-aligned, adj=1 is right-aligned

(take a string, attach a scale 0 to 1 along it, mark the value of adj
on scale, attach that point to the anchor point, i.e. the midpoint of
the plotting frame).
seems to work exactly the same!

The confusion seems to come from wanting 0/0.5/1 to mean
left/center/right-*justified* along the plot frame, which it really
doesn't. 

Even if it did, it wouldn't help, the control really needs to be
two-dimensional: you might want text left/center/right aligned with
the top of the y-axis. The at= parameter *almost* does it, but it is
in user coordinates, rather than frame coordinates. Perhaps we want an
anchor= parameter? -- or even better, a way of attaching units to plot
lengths. This kind of problem also appears with text() and legend()
(ever tried to produce plots with different scales but the legends in
the exact same spot?).