Boris.Vasiliev at forces.gc.ca
2009-Aug-07 16:40 UTC
[R] lattice dotplot: line height for multi-line labels
Dear R-users, I am looking for suggestions on how to control the line-height for multi-line labels in lattice dotplot. In particular, in the dotplot produced by library(lattice) aa <- c('A'=10,'B\nb'=20,'C'=30) dotplot(aa) I would like to control the vertical separation between 'B' and 'b' in the second label on the y-axis. For multi-line axes labels, line height is controlled by the 'lineheight' elements of the 'par.ylab.text' and 'par.xlab.tex' lists provided by trellis.par.get(). However, 'lineheight' is not available in 'axis.text' list retuned by trellis.par.get(). Does lattice provided a 'lineheight' parameter to control line-heights in axis labels? Sincerely, Boris Vasiliev.
Deepayan Sarkar
2009-Aug-07 17:24 UTC
[R] lattice dotplot: line height for multi-line labels
On 8/7/09, Boris.Vasiliev at forces.gc.ca <Boris.Vasiliev at forces.gc.ca> wrote:> Dear R-users, > > I am looking for suggestions on how to control the line-height for > multi-line labels in lattice dotplot. > > In particular, in the dotplot produced by > > library(lattice) > aa <- c('A'=10,'B\nb'=20,'C'=30) > dotplot(aa) > > I would like to control the vertical separation between 'B' and 'b' in > the second label on the y-axis. > > For multi-line axes labels, line height is controlled by the > 'lineheight' elements of the 'par.ylab.text' and 'par.xlab.tex' lists > provided by trellis.par.get(). However, 'lineheight' is not available > in 'axis.text' list retuned by trellis.par.get(). > > Does lattice provided a 'lineheight' parameter to control line-heights > in axis labels?No, but setting it globally as a grid parameter seems to work: dotplot(aa, par.settings = list(grid.pars = list(lineheight = 2))) -Deepayan
Maybe Matching Threads
- lattice dotplot with missing levels in factor variable
- How to auto-scale cex of y-axis labels in lattice dotplot?
- [lattice] lines for stripplot (like dotplot) or jitter for dotplot?
- dotplot: character size of labels
- make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe