Displaying 20 results from an estimated 10000 matches similar to: "FW: Aligning different trellis plots"
2006 Jan 26
1
How to make two side-by side trellis plots same size
Dear Latticers,
I want to position two trellis plots of different forms
side-by-side. The plot types are slightly different,
aspect=1 required, but panels should look the same in
both plots. Current workaround uses a guessed factor.
Any way to improve this?
Dieter
library(lattice)
n1 = 20
# I cannot rbind df1 and df2, because the x-dimensions are
# different and must be scaled individually
2004 Dec 03
1
organising the display in Trellis plots
Hallo,
I would like to organise at my pleasure the layout of a trellis plot.
Currently I have a 3x3 matrix display and 7 plots. Is it possible to
choose which specific panels will stay empty?
I tried index.perm to arrange the order. Then there is perm.cond which I
could not understand if it can serve for my purpose since I cant really
find which kind of data it accepts.
Thank you for the help.
2009 Nov 26
1
Adding text in the panels for Trellis plot ...
i was trying to do a for loop for plotting the histograms , but it doesnt
work properly
> library(lattice)
> columns <- 8:153
> plots <- vector("list", length(columns))
> j <- 0
> for (i in columns)
+ {
+ plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab =
"Frequency",
+ xlab = "Score", xlim = c(1,5), ylim =
2003 Oct 19
2
problem with win.metafile( ): traceback()
For the first error message:
> win.metafile(file = "//.../plot1.wmf",
+ width = 8.5, height = 6.25)
> lset( list( background = list(col = "white")))
Error in get(x, envir, mode, inherits) :
variable "win.metafile://.../plot1.wmf" was not found
> traceback()
4: get(device)
3: trellis.device(device = .Device, new = FALSE)
2: trellis.par.get(item)
1:
2005 Oct 11
1
aligning column of xyplots and removing space between them
The code below displays three graphs in three rows and one column but:
1. I want to remove the space between the graphs (I tried playing with position=
arg to print.trellis but it seems quite difficult to get the right
values and all
my attempts had space between them or had overlapping graphs. Is
there a better way to do this?
2. the widths of the plots are not the same even though I specified
2006 Apr 13
1
panel.abline() and trellis.focus() on multipage plots
Hi,
I'm recently working on a multipage bwplot() using the lattice package. In
this context I was trying to use the panel.abline() function individually on
certain panels but not all. After some research I found the trellis.focus()
and trellis.unfocus() functions which enabled me to do something like:
trellis.focus("panel", 1, 3)
do.call("panel.abline", list
2008 May 11
1
positioning of color key in levelplot
Is there a way of positioning the color key in levelplot when the axes are on a categorical (rather than numerical) scale? I've put some sample code below. I need to add a secondary y axis to the right side of my plot but then the labels interfere with the color key (which is currently on the right side). Is there a way to shift the color key over a bit more to the right? I've tried
2009 Nov 23
3
Trellis Plot
anyone know how to add text in the Trellis plot panel ?? i want to add things
eg: dot dot dot. in the headrer of the panel.
eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png
--
View this message in context: http://old.nabble.com/Trellis-Plot-tp26486579p26486579.html
Sent from the R help mailing list archive at Nabble.com.
2008 Nov 11
1
Retrieving x argument name from a trellis object in R 2.8.0
Dear all,
let consider the following function:
Fun1 <- function() {
library(lattice)
plot1 <- 1:10~1:10
pl1 <- xyplot(plot1)
return(pl1$call$x)
}
In R 2.5.0 (or older version) we have
> Fun1()
plot1
but starting from R 2.5.1 until the latest R 2.8.0 we obtain instead
> Fun1()
NULL
because pl1$call seems to be equal to xyplot() without arguments.
Something like
2007 Dec 28
1
two plots on the same page
I'd like to know why I cannot get a plot and the QQnorm in the same sheet.
The commands are simple but:
library(nlme)
glmod1 <- gls(upfmla,correlation=corAR1(),method="ML")
summary(glmod1)
par(mfrow = c(2,1))
plot(glmod1, main="GLS Residuals vs. GLS Fitted")
qqnorm(glmod1)
No matter what (I tried different permutations of the plotting commands) the
second drawing
2002 Sep 09
1
multiple "keys" in Trellis plots?
My xyplot has a number of panels, and I'd like a separate key for each
rather than a single key for the entire set. However, I cannot find a way to
pass multiple key definitions to xyplot's "key" argument.
Allow me to throw out a simple example:
require(methods)
require(lattice)
## define sample data
myFrame1 <- data.frame(a=1:100, b=rep(1:10,10), c=unlist(lapply(1:10, rep,
2013 Feb 22
4
Controlling Order of Panels in Lattice Trellis Plots
With multiple panels in a lattice trellis plot the sequence is, for
example, 1, 10, 11, 12, 2, 3, 4. I want the sequence to be 1, 2, 3, 4, 10,
11, 12.
Reading ?strip.default and the appropriate section in the Lattice book I'm
not seeing how to specify the 'human' numeric order rather than the computer
numeric order.
A pointer will be appreciated.
TIA,
Rich
2012 Dec 11
1
Focus on a sub-panel of a splom with trellis.focs() -- return coordinate of sub-panel, or names of variables therein
Hi,
I'd like to be able to generate a splom plot in R and then use my mouse to click on one of the sub-panels (panel.pairs, specifically) and have R return either the coordinates of that sub-panel, or even better, the names of the corresponding variables plotted in that sub-panel.
Here's an example to work with:
> library(lattice)
> splom(~iris[1:4], groups = Species, data = iris,
2018 Apr 14
2
Extracting specified pages from a lattice ("trellis") object.
Suppose that (e.g.) xyplot() returns an object "xxx" with (say) 3 pages.
I would like to extract/plot (print) just one of these pages, e.g.
page 2.
Here's a toy example:
x <- rep(seq(0,1,length=11),12)
set.seed(42)
y <- rnorm(3*44)
a <- rep(letters[1:12],each=11)
dta <- data.frame(x=x,y=y,a=a)
xxx <- xyplot(y~x|a,data=dta,layout=c(2,2))
I would to extract from
2006 Nov 06
1
line width (all elements) in Trellis
Dear All,
I am hoping to implement a barchart using trellis graphics where all
elements have a line width of 2.
Using trellis.par.set(), I am able to make most elements lwd=2, but not
all. In particular, the top of the box (above the upper most strip) and
the left y-axis remain one point.
Code with a barchart() example is below. Any advice would be greatly
appreciated.
Thanks for your
2011 Dec 30
1
Lattice: Setting Conditioning Panel Order in Trellis Plots
I've looked in Deepayan Sarkar's book without finding how to specify the
order of conditioning panels in a trellis plot. Here's the issue I'm trying
to resolve:
Sampling locations along a stream channel are not sequentially numbered.
For example, the panel order for one plot (lower left to upper right, 4
panels per row): SC, SC-1, SC-100, SC-139, SC-140, SC-141, SC-145. SC-2,
2006 Dec 13
1
Passing arguments to panels in trellis plots
Dear all,
I am trying to produce survfit plots in a trellis environment and I
would like the plots to be logarithmic.
I am trying this:
print(Ecdf(~time | size*type, groups=alg,data=B,subscripts=TRUE,
panel=function(x,groups,subscripts)
{
t <- survfit(Surv(time[subscripts],event[subscripts])~groups[subscripts],data=B)
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component <- function(...)
{
ans <- yscale.components.default(...)
ans$right <- ans$left
foo <-
2009 Mar 31
2
To save Trellis Plots on A3 size paper (Portrait and Landscape)
Dear R users,
Thanks in advance.
I am Deb, Statistician at NSW Department of Commerce, Sydney.
I am using R 2.8.1 on Windows XP.
I like to save Trellis Plots on A3 size paper (Portrait and
Landscape).
Currently, I am using the following command to save a Trellis Plot in
pdf [This is an example code]:
pdf("D:/Analysis/test.pdf")
dataFile <- expand.grid(xo=
2006 Aug 09
1
legend on trellis plot
Dear all
I have two questions regarding trellis plots - which I hope you may be able to help me with.
Is it possible to place the key in a trellis plot on the panel (instead of beside the panel)? This will cause the same key to be reproduced on each panel. Please see the plot below - here I placed the legend below the plot. I tried moving the key to the function statement, but it did not really