Hi, I am doing fine editing on a lattice plot, now have the Y-axis title in the correct position, but the tick labels are too far from the axis line. I looked at the help documentation but could not find how to change this. This seems to be easy to do in basic plots with "at=c(value1, value2, value3)" . Is there some equivalent in lattice? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Lattice-distance-of-tick-labels-from-axis-line-tp3693014p3693014.html Sent from the R help mailing list archive at Nabble.com.
On 2011-07-25 07:54, marcel wrote:> Hi, I am doing fine editing on a lattice plot, now have the Y-axis title in > the correct position, but the tick labels are too far from the axis line. I > looked at the help documentation but could not find how to change this. This > seems to be easy to do in basic plots with "at=c(value1, value2, value3)" . > Is there some equivalent in lattice? Thanks.axis.components is a list of parameters for the 4 sides of a plot. You probably want the left side parameter 'pad1': d <- data.frame(x=1:10, y=sample(10)) xyplot(y ~ x, data=d, par.settings=list( axis.components=list( left=list(pad1=0.5)))) Peter Ehlers> > -- > View this message in context: http://r.789695.n4.nabble.com/Lattice-distance-of-tick-labels-from-axis-line-tp3693014p3693014.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
Thank you, this works well - overall, I now have pretty good control over the appearance of the L-hand side of the plot and relative distance between axis line, ticks, tick labels and axis title by adjusting pad1, pad2 and the plot position in the print statement. I am sure it is not the best code, but I will throw in the relevant lines in case anyone else has encountered this problem. par.settings = list(layout.widths = list(ylab.axis.padding = 0.1), axis.components=list(left=list(pad1=0.2, pad2=1.8))) print(plot2, position=c(-0.0068,0.221,0.741,0.466)) -- View this message in context: http://r.789695.n4.nabble.com/Lattice-distance-of-tick-labels-from-axis-line-tp3693014p3696157.html Sent from the R help mailing list archive at Nabble.com.
Apparently Analagous Threads
- [lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")
- Adjust the distance between tick mark labels and axis
- lattice: axis ticks, axis alignment and remove axis from plot
- remove NA in df results in NA, NA.1 ... rows
- How to arrange the data