[R] rotate levelplot

Kang Min ngokangmin at gmail.com
Sun Oct 25 06:51:25 CET 2009


Hi Milton,

The matrix can be generated using

p = matrix(1:50, nrow=5)

If I just use levelplot(p), it gives me a graph that is vertical. How
can I rotate it so it becomes horizontal?
I cannot do

q = t(p); levelplot(q)

because this is representing a map from a piece of land, transposing
the data will flip the map upside down laterally.

Thanks,
Kang Min

On Oct 25, 12:40 pm, milton ruser <milton.ru... at gmail.com> wrote:
> Hi Kang,
>
> Could you send a reproducible sample-code?
>
> Bests
>
> miltinho
>
>
>
> On Sat, Oct 24, 2009 at 11:32 PM, Kang Min <ngokang... at gmail.com> wrote:
> > Hi all,
>
> > I have a matrix with 5 rows and 10 columns, which represent the grids
> > on a rectangular map.
> > I used the code below to plot, but it gives me the map with the 10
> > columns as y-axis, and the 5 rows as the x-axis, and the (0,0) point
> > is at the usual bottom left hand corner. My map starts with the (0,0)
> > at the top left hand corner.
>
> > How can I rotate the map 90 degrees clockwise so the (0,0) starts at
> > the top left? That means I need the 10 columns to be x-axis. I cannot
> > transpose the matrix because the map would be laterally flipped over.
>
> > levelplot(quadsec.mat, colorkey=list(space="bottom"), scales=list
> > (tick.number=10), aspect=c("iso"))
>
> > Thanks, I'm ready to give more information if needed.
>
> > Kang Min
>
> > ______________________________________________
> > R-h... 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<http://www.r-project.org/posting-guide.html>
> > and provide commented, minimal, self-contained, reproducible code.
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list