Questions tagged [lattice]

lattice is a package that forms part of base R and allows the creation of trellis-type graphics.

R's lattice package, developed by Deepayan Sarkar, is a port of Bell Laboratories' Trellis Graphics to R. It is one of the three main graphics options in R, the other two being R's base graphics capabilities and .

Repositories

Vignettes

Books

Other resources

R packages extending lattice

  • latticeDensity: Density estimation and nonparametric regression on irregular regions.
  • latticeExtra: Extra Graphical Utilities Based on Lattice.
  • latticist: A graphical user interface for exploratory visualisation.
  • latticedl: Lattice direct labels, for automatically labeling points.

Related tags

1251 questions
0
votes
2 answers

centering text across panels of an annotated lattice figure

I have a multi-panel lattice figure. It has an even number of equal-width columns. I would like to center text across the columns. Sometimes, this is easy to do. For example, the xlab and main arguments often handle this job nicely. But I want a…
user697473
  • 2,165
  • 1
  • 20
  • 47
0
votes
2 answers

How to add a single new contour to a contour plot in Lattice

I have produced a filled contourplot using contourplot function in the Lattice package. I would like to be able to emphasise one of the contour lines produced by this function, e.g. by changing lwd=2, and de-emphasise the other contour lines…
JonMinton
  • 1,239
  • 2
  • 8
  • 26
0
votes
1 answer

Plot two size vector length with xyplot

Please note that this is a simplified version (and therefore duplicate of my earlier post): https://stackoverflow.com/questions/18358694/xyplot-2-separate-data-frame-lengths It may well be that it contained too much information, however quite basic…
Maximilian
  • 4,177
  • 7
  • 46
  • 85
0
votes
1 answer

Parameters to pass auto.key to draw symbols in the key

I am trying to create an xyplot with the key on the right hand side and symbols as well as lines (which have to be given in the key as well). I'm running the following code: xyplot(value ~ variable | conditionCol1 + conditionCol2, data…
Tania
  • 285
  • 1
  • 4
  • 13
0
votes
1 answer

R: levelplot vs. contourplot

I want to plot a contour of my data in R. What is the difference between levelplot vs. contoutplot in package lattice and latticeExtra in R?
Vahid Mirjalili
  • 6,211
  • 15
  • 57
  • 80
0
votes
1 answer

How can I simplify a lattice xyplot with millions of data points?

I have multiple sets of time history data collected at approximately 500 Hz for 12 hours at a time. I've plotted this data using an xyplot with type="l" on a log time scale, as the phenomenon is largely a logarithmic decay. The resulting plots are…
mac
  • 3,137
  • 1
  • 28
  • 42
0
votes
2 answers

Plotting straight surface with lattice::wireframe()

Assume I want to plot the following dataframe: df <- data.frame(expand.grid(1:10,1:10),rep(10,100)) colnames(df) <- c("x","y","z") with the lattice wireframe() function: wireframe(z~x*y,df,colorkey=TRUE,drape=TRUE) How do I get it to plot the…
Julian
  • 1,573
  • 2
  • 22
  • 36
0
votes
0 answers

"Bunching" of barcharts in lattice

I'm a bit stumped by some irregular plotting from barchart from the lattice package in R. Specifically, I'm attempting to do a multiplot of barcharts of frequency data for some demographic information. The following code should load my data…
danielg7
  • 1
  • 1
0
votes
0 answers

Plot small ranged data in histogram

I have data that is mostly centered in a small range but there is a significant number of points which are out of this range. I would like to plot a histogram for this data that will focus on the small range but will also show the outliers.…
Klaus
  • 1,946
  • 3
  • 19
  • 34
0
votes
1 answer

Lattice - Matrix-like Strips

I'm trying to add strips to a superimposed wireframe-plot in a matrix-like fashion: library(lattice) g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) cond1 <- c(rep(1,2*dim(g)[1]),rep(2,2*dim(g)[1])) cond2 <-…
Joseph
  • 3
  • 1
0
votes
1 answer

In lattice histogram how to keep only 99% of the data?

In my lattice histogram: histogram(~bill|group,data=mydat,type='count',nint=50,layout=c(9,3)) How to keep "bill" data before 99th percentile within each group?
kuki
  • 303
  • 2
  • 6
  • 15
0
votes
2 answers

How to add a third factor to the x axis in a lattice bwplot

I am very new to plotting data and I am trying to add a third factor to my bwplot. My factors are: Site with 6 levels (C0, C1, C2, C3, C4, C5) Seasonal Flow with 2 levels (High, Low) Land Use with 2 levels (Urban, Rural) I have no trouble…
0
votes
0 answers

How to remove one side of the axes label in scatterplot matrix (splom in R)?

I have created a scatterplot matrix using splom in R but the reviewer is not happy with having the axes label on both sides in each of the matrix. Anyone know how to get axis label only on one side? Here is a my R code below: print(splom(~d[11:16],…
0
votes
0 answers

R Lattice Graphics - Removing axes from particular panels

I am using the following code to generate the enclosed figure: xyplot(data$SA..m2.g.~ date2 | data$RH*data$type, groups=data$env, pch=c(19,15,1), col=c("gray50","black","black"),cex=1.3, xlab=list("Time (days)", cex=1.6),…
0
votes
1 answer

Adding mean line and text label to lattice histogram

Aloha - I am creating a series of histograms and would like to add a vertical line indicating the mean value of the distribution as well as a text label indicating the sample size. My code is as follows: BIN_WIDTH <- 1 #desired bin…
Ben
  • 167
  • 1
  • 3
  • 10