Skip to content

Disappearing x axis in plot.factor (PR#830)

3 messages · Peter Dalgaard, Thomas J Vogels

#
Hi.

While there is an x-axis set up for:
this axis is not present for
which actually should just be the same as the first plot and call
barplot(table(.)), shouldn't it?  Where did the ticks and labels go?

Note that
has the x-axis.

Something funky is going on with axisnames or args in plot.factor that
I can't figure out.  The situation can be remedied with
alas, why do you need "axes=TRUE"?

Regards,
  -tom



Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:
--please do not edit the information below--

Version:
 platform = i386-pc-linux-gnu
 arch = i386
 os = linux-gnu
 system = i386, linux-gnu
 status = 
 major = 1
 minor = 2.1
 year = 2001
 month = 01
 day = 15
 language = R

Search Path:
 .GlobalEnv, package:ctest, Autoloads, package:base
#
tov@ece.cmu.edu writes:
Because of the logic of

        axisnames <- if (length(dargs <- list(...)) > 0) {
            nam <- names(dargs)
            ((any("axes" == nam) && dargs$axes) || (any("xaxt" == 
                nam) && dargs$xaxt != "n"))
        }

gives FALSE if there are any "..." arguments, and neither of axes= and
xaxt= are given.

I think the first part of plot.factor wants to be 

     if (missing(y) || is.factor(y)) {
	dargs <- list(...)
        axisnames <- if (!is.null(dargs$axes)) dargs$axes
	    else if (!is.null(dargs$xaxt)) dargs$xaxt != "n"
            else TRUE
    }

Anyone know better?
#
Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:
snip
This works for me at least.  Thank you very much,

  -tom