Bug 14538 - asymmetry of x and y axes
asymmetry of x and y axes
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Graphics
R-devel (trunk)
All All
: P5 trivial
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-21 21:41 UTC by Philip Johnson
Modified: 2011-03-26 08:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Johnson 2011-03-21 21:41:57 UTC
x-axis and y-axis labels (actually mtext in general) are not symmetric with respect to each other -- at least for pdf, postscript and x11 output devices.  This is only slightly noticeable for the default graphics parameters.
     mtext("blah", adj=0.2, line=0, side=1)
     mtext("blah", adj=0.2, line=0, side=2)

That said, changing this to be symmetric would result in slight shifts in the placement of margin text in *all* plots.

"Fixing" this behavior requires only minor changes to the code, mostly in the yLineBias "visual tuning" device parameter (see bug #
14532; Brian Ripley responded to that bug and pointed out that any change to
visual placement should be carefully considered under a separate report).
Comment 1 Brian Ripley 2011-03-24 10:46:34 UTC
It is not clear why you mean: the labels are inverted relative to the line
and "blah" is not a symmetric string, so the results should be asymmetric.

For a better (but not perfectly symmetric) example try "bq".
Comment 2 Philip Johnson 2011-03-25 21:26:42 UTC
Apologies for being unclear.  When I write "asymmetry," I mean if you draw a rectangle around the text of a label on side=1 and compare with a rectangle around the same text on side=2, then you will find different amounts of space between the edge of the rectangle and the edge of the figure (or the box drawn around the plot).

The symmetry of the string itself does not affect this asymmetry in positioning.  In the "bq" example, the baseline of the label on side=2 is marginally above the box drawn around the plot, and the tail of "q" crosses into the plot region.  The label on side=1, on the other hand, is distinctly below the box surrounding the plot and the top of the "b" is distinctly below the plot region.

In my opinion, the baseline of side=1 should be higher to be symmetric.  (This could be accomplished by increasing yLineBias)
Comment 3 Brian Ripley 2011-03-26 08:44:34 UTC
yLineBias is made consistently 0.2 across all devices in the R distribution in the trunk.
Comment 4 Brian Ripley 2011-03-26 11:45:41 UTC
On Fri, 25 Mar 2011, r-bugs@r-project.org wrote:

> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14538
>
> --- Comment #2 from Philip Johnson <plfjohnson@emory.edu> 2011-03-25 16:26:42 EDT ---
> Apologies for being unclear.  When I write "asymmetry," I mean if you draw a
> rectangle around the text of a label on side=1 and compare with a rectangle
> around the same text on side=2, then you will find different amounts of space
> between the edge of the rectangle and the edge of the figure (or the box drawn
> around the plot).


Which as I said, is the correct result.  Your box is not including the 
space below the baseline.

>
> The symmetry of the string itself does not affect this asymmetry in
> positioning.  In the "bq" example, the baseline of the label on side=2 is
> marginally above the box drawn around the plot, and the tail of "q" crosses
> into the plot region.  The label on side=1, on the other hand, is distinctly
> below the box surrounding the plot and the top of the "b" is distinctly below
> the plot region.
>
> In my opinion, the baseline of side=1 should be higher to be symmetric.  (This
> could be accomplished by increasing yLineBias)


Which depends on the font and the device.

> -- 
> Configure bugmail: https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
> _______________________________________________
> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595