title: Exact axis ticks and labels in R Lattice xyplot
body: <p>I'm creating many plots (each as a separate image) that all must have identical axis limits. When using ylim, the tick marks are awkwardly placed at the extreme edges and tick labels are omitted for the extreme values. </p>
  
  <pre><code>library(lattice)
  x=1:100
  y=10+20*(runif(100))
  xyplot(y~x)                 # Case 1 - automatic ylim
  xyplot(y~x, ylim=c(10,20))  # Case 2 - specified ylim
  </code></pre>
  
  <p>In Case 1, the axis ticks and labels are automatically generated at (y=10,15,20,25,30). All tick marks are labeled, and there is some vertical padding for the extreme tick marks (y=10 and y=30) in the plot rectangle.</p>
  
  <p>In Case 2, when I specify ylim values, the tick marks are generated at (y=10,12,14,16,18,20) but labels appear only for (y=12,14,16,18). Tick labels are missing at the extremes. Also, there is no vertical padding for the extreme tick marks in the plot rectangle. </p>
  
  <p>Is there a way to specify ylim and still have the tick marks and labels come out similarly to Case 1?</p>
  
  <p>More generally, when specifying ylim:<br>
  1. how can you specify exactly where each tick mark goes? <br>
  2. how can you specify exactly which tick marks get labeled?</p>