Hi all -
I am far from fluent in R and need some help polishing up a figure I am
trying to create. I wish to make a "tileplot" (from package
extraLattice)
where the x axis is time (months; may - sept) and the y axis is space
(fishery management zones). Here is my code so far:
tileplot(effort~month_num*-area_num,mae,col.regions=topo.colors(100),
border = "black",
pch = ifelse(is.na(mae$effort), 4, 21),
panel = function(...){
panel.fill("black")
panel.voronoi(...)
})
This produces axis that looks something like (except with colored tiles):
-1
-2
-3
-4
-5
-6
-7
-8
5 6 7 8 9
But I'm hoping to have tick labels that look like:
T
N
C
B
KC
FB
SF
MO
May June July August September
Thanks in advance for any insight.
Regards,
Ryan Flaherty
Oregon State University
College of Oceanic and Atmospheric Science
Marine Resource Management
541-513-0293
rflaherty@coas.oregonstate.edu <mailto:flahertr@onid.orst.edu>
[[alternative HTML version deleted]]
On Aug 23, 2012, at 2:19 PM, Ryan Flaherty wrote:> Hi all - > > I am far from fluent in R and need some help polishing up a figure I > am > trying to create. I wish to make a "tileplot" (from package > extraLattice)I'm guessing that you meant to write: latticeExtra> where the x axis is time (months; may - sept) and the y axis is space > (fishery management zones). Here is my code so far: > > tileplot(effort~month_num*-area_num,mae,col.regions=topo.colors(100), > border = "black", > pch = ifelse(is.na(mae$effort), 4, 21), > panel = function(...){ > panel.fill("black") > panel.voronoi(...) > })The help page for xyplot has information about the scales argument which is what you should constructing when you want to modify the plot axis annotation in lattice functions. perhaps something like scales=list( x=list(at=1:5, labels=c('May' , 'June','July','August','September') ), y=list(at=(-8):-1, labels=c('T','N','C','B','KC','FB','SF','MO')) )> This produces axis that looks something like (except with colored > tiles): > > -1 > -2 > -3 > -4 > -5 > -6 > -7 > -8 > > 5 6 7 8 9 > > But I'm hoping to have tick labels that look like: > > T > N > C > B > KC > FB > SF > MO > May June July August September > > Thanks in advance for any insight. >You can thank us by posting in plain text next time. - David Winsemius, MD Alameda, CA, USA
Possibly Parallel Threads
- latticeExtra tileplot question - tiles are not all the same size, need help.
- is it possible to create a trellis object with multiple colorkeys/z-scale axis?
- Convert tileplot's trellis to shapefile/ Add values to voronoi polygon
- Funky password mount point error for liveice and ic ecast - PLZ HL P!
- [ ] within [ ]