Hi all, I am trying to remove the current labels of the tick marks and replace them with text using xyplot within lattice right now I have tick marks at 1, 1.5, 2, 2.5, 3 I would like to transform them to say 'T1', 'T2', 'T3' thanks in advance Kathleen -- View this message in context: http://r.789695.n4.nabble.com/Removing-tick-marks-and-Adding-labels-to-lattice-plots-tp3052006p3052006.html Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2010-Nov-20 23:45 UTC
[R] Removing tick marks and Adding labels to lattice plots
On Nov 20, 2010, at 6:32 PM, kateF87 wrote:> > Hi all, > > I am trying to remove the current labels of the tick marks and > replace them > with text using xyplot within lattice > > > right now I have tick marks at 1, 1.5, 2, 2.5, 3 I would like to > transform > them to say 'T1', 'T2', 'T3'In the xyplot documentation you will find the controls for ticks and labels in the scale section. You have not given a well-formed example because the number of labels does not align with the number of ticks so I am going to assume there are currently 5 ticks to be relabeled. Perhaps something along these lines: xyplot( <some-formula> , data=<dfrm, scales=list(x=list(labels=c('T1', 'T2', 'T3' , 'T4', 'T5'))) ) Notice the way the arguments are all packaged as nested lists. That the way lattice works. -- David Winsemius, MD West Hartford, CT
Reasonably Related Threads
- lattice splom: how to adjust space between tick marks and tick labels?
- Creating new variable with maximum visit date by group_id
- Rotated, Right-Justified Labels for Shortened Tick Marks
- Month tick marks on a plot()
- [ggplot] controlling axis and major/minor tick marks