Skip to content

bwplot puts the bars in the wrong place

1 message · James Rome

#
Peter, that finally worked.

        hrs = seq(1, 24, 1)                       
        g = bwplot(tt~OnHFact |Runway, data=gdf, ylab="Taxi time (min)",
        main=title, xlab="Hour of day",  par.strip.text=list(cex=0.7),
rot=90,  xlim=c(0, 25),
        drop.unused.levels=FALSE, scales=list(x = list(rot=90, cex=.6
        ,at=hrs, labels=hrlabs
        )),
        panel = function(x, ...) {
            panel.grid(h = -1, v = 24)                               
                           
            panel.bwplot(x, ...)                                       
                                                                       
                                                                       
                                                               
      } )
        print(g)

But, it seems a lot easier and safer to call xyplot() and panel.bwplot()
without factors. The scary thing here is that you must look very closely
at the data and the plot to see that there is an error.

Thanks for the help,
Jim

On 4/19/2010 10:44 PM, Peter Ehlers wrote:James,

It's actually the bars for hour 3 (which don't exist) that are
missing. You still need the 'drop.unused.levels=FALSE' and if
you make 'OnHour' into a factor then you won't need the
'horizontal=FALSE'.

 -Peter Ehlers
On 2010-04-19 8:27, James Rome wrote:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bwplotGood.PNG
Type: image/png
Size: 52549 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100420/6a165dba/attachment.png>