[R] Drawing ticks in the 3rd and 4th row of a lattice

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Nov 22 16:42:18 CET 2011


On Fri, Nov 18, 2011 at 11:22 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote:
> Dear all,
>
> I want to draw ticks on the 3rd and 4th row of a lattice. How do I do this
> ? In my search of the help, I discovered a parameter alternating,which kind
> of says where the ticks will be but does not suffice for me.

You need to explain more clearly what you want. Your plot does already
have ticks in the 3rd and 4th row. If you need the x-axes labeled in
each row, you need to have something like

         scales=list(x = list(relation = "free", rot = 45, ...

-Deepayan

> I am running this command : -
>
> barchart(X03/1000~time|Company,
>         data=df1[which(df1$time!=1),],
>         horiz=F,
>
> scales=list(x=list(rot=45,labels=paste("Mar",c("07","08","09","10","11"))))
>         ,par.strip.text=list(lineheight=1,lines=2,cex=.75),
>         ylab = "In Rs.
> Million",xlab="",layout=c(3,4),as.table=T,between=list(y=1))
>
>
> where my data is  : -
>
>> dput(df1)
> structure(list(Company = structure(c(9L, 7L, 1L, 6L, 8L, 4L,
> 2L, 5L, 11L, 10L, 9L, 7L, 1L, 6L, 8L, 4L, 2L, 5L, 11L, 10L, 9L,
> 7L, 1L, 6L, 8L, 4L, 2L, 5L, 11L, 10L, 9L, 7L, 1L, 6L, 8L, 4L,
> 2L, 5L, 11L, 10L, 9L, 7L, 1L, 6L, 8L, 4L, 2L, 5L, 11L, 10L, 9L,
> 7L, 1L, 6L, 8L, 4L, 2L, 5L, 11L, 10L), .Label = c("Bharat Petroleum Corpn.
> Ltd.",
> "Chennai Petroleum Corpn. Ltd.", "Company Name", "Essar Oil Ltd.",
> "Hindalco Industries Ltd.", "Hindustan Petroleum Corpn. Ltd.",
> "Indian Oil Corpn. Ltd.", "Mangalore Refinery & Petrochemicals Ltd.",
> "Reliance Industries Ltd.", "Steel Authority Of India Ltd.",
> "Sterlite Industries (India) Ltd."), class = "factor"), time = c(7,
> 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,
> 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
> 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1), X03 = c(722931.1, 751620.5, 304456.3, 294868.9, 192712.6,
> 36695.4, 188313.4, 98954.9, 100088.7, 72379.9, 848517.5, 864562.2,
> 347310.9, 301022.1, 253514.5, 165661.6, 206377.7, 108897, 109336.3,
> 71207.6, 1003504.6, 1145993.8, 392261.5, 341086, 289737.4, 359837.2,
> 252964.3, 90036.2, 90474.8, 127623.2, 1411082.1, 907480.4, 364637.5,
> 290915.7, 255397.4, 328557.2, 202855.3, 118725.4, 116647.6, 106254.9,
> 1772254.7, 1204856.9, 469935.6, 313527.6, 320131.1, 384323.5,
> 260813.9, 137403.3, 137238.5, 136888.4, 1151658, 974902.76, 375720.36,
> 308284.06, 262298.6, 255014.98, 222264.92, 110803.36, 110757.18,
> 102870.8)), row.names = c("Reliance Industries Ltd..7", "Indian Oil Corpn.
> Ltd..7",
> "Bharat Petroleum Corpn. Ltd..7", "Hindustan Petroleum Corpn. Ltd..7",
> "Mangalore Refinery & Petrochemicals Ltd..7", "Essar Oil Ltd..7",
> "Chennai Petroleum Corpn. Ltd..7", "Hindalco Industries Ltd..7",
> "Sterlite Industries (India) Ltd..7", "Steel Authority Of India Ltd..7",
> "Reliance Industries Ltd..8", "Indian Oil Corpn. Ltd..8", "Bharat Petroleum
> Corpn. Ltd..8",
> "Hindustan Petroleum Corpn. Ltd..8", "Mangalore Refinery & Petrochemicals
> Ltd..8",
> "Essar Oil Ltd..8", "Chennai Petroleum Corpn. Ltd..8", "Hindalco Industries
> Ltd..8",
> "Sterlite Industries (India) Ltd..8", "Steel Authority Of India Ltd..8",
> "Reliance Industries Ltd..9", "Indian Oil Corpn. Ltd..9", "Bharat Petroleum
> Corpn. Ltd..9",
> "Hindustan Petroleum Corpn. Ltd..9", "Mangalore Refinery & Petrochemicals
> Ltd..9",
> "Essar Oil Ltd..9", "Chennai Petroleum Corpn. Ltd..9", "Hindalco Industries
> Ltd..9",
> "Sterlite Industries (India) Ltd..9", "Steel Authority Of India Ltd..9",
> "Reliance Industries Ltd..10", "Indian Oil Corpn. Ltd..10", "Bharat
> Petroleum Corpn. Ltd..10",
> "Hindustan Petroleum Corpn. Ltd..10", "Mangalore Refinery & Petrochemicals
> Ltd..10",
> "Essar Oil Ltd..10", "Chennai Petroleum Corpn. Ltd..10", "Hindalco
> Industries Ltd..10",
> "Sterlite Industries (India) Ltd..10", "Steel Authority Of India Ltd..10",
> "Reliance Industries Ltd..11", "Indian Oil Corpn. Ltd..11", "Bharat
> Petroleum Corpn. Ltd..11",
> "Hindustan Petroleum Corpn. Ltd..11", "Mangalore Refinery & Petrochemicals
> Ltd..11",
> "Essar Oil Ltd..11", "Chennai Petroleum Corpn. Ltd..11", "Hindalco
> Industries Ltd..11",
> "Sterlite Industries (India) Ltd..11", "Steel Authority Of India Ltd..11",
> "Reliance Industries Ltd..1", "Indian Oil Corpn. Ltd..1", "Bharat Petroleum
> Corpn. Ltd..1",
> "Hindustan Petroleum Corpn. Ltd..1", "Mangalore Refinery & Petrochemicals
> Ltd..1",
> "Essar Oil Ltd..1", "Chennai Petroleum Corpn. Ltd..1", "Hindalco Industries
> Ltd..1",
> "Sterlite Industries (India) Ltd..1", "Steel Authority Of India Ltd..1"
> ), .Names = c("Company", "time", "X03"), reshapeLong = structure(list(
>    varying = structure(list(X03 = c("X03.07", "X03.08", "X03.09",
>    "X03.10", "X03.11", "X03.1")), .Names = "X03", v.names = "X03", times =
> c(7,
>    8, 9, 10, 11, 1)), v.names = "X03", idvar = "Company", timevar =
> "time"), .Names = c("varying",
> "v.names", "idvar", "timevar")), class = "data.frame")
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list