[R] Key colour problem with lattice plot

From: Geoff Russell <geoffrey.russell_at_gmail.com>
Date: Sun 22 Oct 2006 - 11:21:56 GMT


Hi,

I seem to have a key colour problem with a lattice barchart. The colours on my key rectangle don't match the colours on the barchart.

Here is my data frame:

"LandFill" "Ruminants"
"United States (USA)" 7777.21428 5528.16
"France" 200.527083 1299.87
"Australia" 185.878368 2448.17
"Russian Federation" 1752.8334 2024.29
"Argentina" 283.98732 2567.02
"Brazil" 1048.42248 8839.61
"Colombia" 265.125 1307.61
"Mexico" 981.023351 1814.89
"Ethiopia" 9.38020424 1237.49
"Sudan" 16.0184936 1796.67
"India" 553.425328 12360.3
"Pakistan" 47.1593928 2346.71
"China" 455.680191 8041.79

> example

                       LandFill Ruminants
United States (USA) 7777.214280   5528.16
France               200.527083   1299.87
Australia            185.878368   2448.17
Russian Federation  1752.833400   2024.29
Argentina            283.987320   2567.02
Brazil              1048.422480   8839.61
Colombia             265.125000   1307.61
Mexico               981.023351   1814.89
Ethiopia               9.380204   1237.49
Sudan                 16.018494   1796.67
India                553.425328  12360.30
Pakistan              47.159393   2346.71
China                455.680191   8041.79


And here is my plotting statement.

>barchart(rownames(example)~example$LandFill+example$Ruminants,type=c("p","h"), key=list(text=list(c("Landfill","Enteric Fermentation")), rectangles=Rows(trellis.par.get("superpose.symbol"),c(1,2))))))

Cheers,
Geoff Russell



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Oct 22 21:28:23 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 23 Oct 2006 - 09:30:13 GMT.

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