[Rd] Minor bug: plot.table and Axis.table (partially) ignore graphical parameters (patch included)

From: Martin Becker <martin.becker_at_mx.uni-saarland.de>
Date: Tue, 17 Apr 2012 12:13:45 +0200

Dear developers,

currently (rev 59060), plot.table and Axis.table do not forward their '...' argument to their calls to axis(). Thus, some graphical parameters (such as col.axis, cex.axis, font.axis) in '...' are ignored (for plot.table: partially ignored [for the x-axis]), which seems to be a minor bug. As a minimal reproducible example, see e.g.:

   plot(table(rbinom(100,5,0.5)), col.axis="red", cex.axis=2, font.axis=2)

Apparently, this behaviour is mainly caused by a suboptimal implementation of (undocumented) support for the logical parameter 'axes' in plot.table's as well as Axis.table's '...' argument.

I propose to change the implementation as follows:
- make 'axes' an explicit argument of plot.table (as in plot.default,
with default TRUE)
- drop support for the 'axes' flag in Axis.table's '...' argument (which
is neither documented nor supported by other Axis.* functions AFAICS)
- in plot.table and Axis.table, forward '...' to axis() (in plot.table:
"filtered" via a localaxis()-function similar to localAxis() in plot.default)

This would remove the minor bug and simplify the code. As a downside, the change breaks code which uses 'axes' as '...'-argument in a call to Axis.table(). But, as already mentioned, this is neither documented nor working for other methods of Axis.

So, please consider applying the attached (not fully tested, but trivial) patch.

Thank you and best wishes,

Dr. Martin Becker, Akad. Rat
Statistics and Econometrics
Saarland University
Campus C3 1, Room 217
66123 Saarbruecken

______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Received on Tue 17 Apr 2012 - 10:33:11 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 Apr 2012 - 18:50:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive