Skip to content

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

1 message · Martin Becker

#
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,
Martin