Displaying 20 results from an estimated 9000 matches similar to: "rotated ylab with xyplot"
2005 Apr 14
2
Legend in xyplot two columns
Dear R-Help
I have some trouble to set the legend in a xyplot into two rows.
The code below gives me the legend in the layout I am looking for, I
just rather have it in two rows.
library(lattice)
schluessel <- list(
points=list( col="red", pch=19, cex=0.5 ),
text=list(lab="John"),
lines=list(col="blue"),
2011 Jun 16
1
Placing Text on ggplot2 graphics vs. xyplot
Greetings to the help mailing list.
I am in the process of translating a large graphic from xyplot to ggplot2 (13 columns by about rows).
I have been unsuccessful trying to understand how to place the following text strings after three days of:
* Perusing Wickham's "gg2plot" book;
* Searching his site for gg2plot and qplot;
* Reviewing the "man pages" for gg2plot;
*
2005 Feb 18
1
Examples of multiple key grobs
The xyplot help page gives quite a lot of information how to use key
and indicates that legend needs to be used if multiple keys are
needed. However, it gives only a brief description of what the grob
needs to contain to do multiple keys.
I've only used the occasional grid function in panel functions, so I
don't have much of a sense of how grobs are constructed. I've been
unable to
2007 May 26
1
lattice: aligning independent graphs
I find myself wanting to plot three graphs side by side 'as if' they
were panels -- that is, with the same y-axis limits, no space between
the graphs, and precise vertical alignment of the plot areas. However,
I don't want strip titles; I want each graph to have its own x-axis
label, on the bottom of the plot.
The best way I have so far found to do this is to fake up a data frame
that
2010 Mar 29
1
xyplot second y-xis and legend
Dear list,
I try to set a secondary y-axis in a lattice xyplot. This works. However, I
am unable to set a proper legend/key together with the 2nd y-axis under
general xyplot procedures. See example below.
The combination of the par.settings with simpleTheme and other settings
seems to go wrong.
I couldn't find a solution from previous topics. Any suggestions? thanks in
advance!
Robbert
2010 Mar 19
2
lattice grob
Dear list,
I'm trying to arrange various grid objects on a page using a
frameGrob. It works fine with basic grobs (textGrob, gTree, etc.), and
also with ggplot2 objects using the ggplotGrob() function. I am
however stuck with lattice. As far as I understand, lattice produces a
list of class trellis, which is eventually displayed using the
plot.trellis method. I am not sure if/how one can
2007 Jun 18
1
Second y-axis in xyplot (lattice) where y1 and y2 have different ranges
Hi all,
I realize this is asking a lot of lattice, but I want to add a second y
axis inside a xyplot and have y1 and y2 have different ranges. Given dat
below, I can add a second y axis by overlaying a new plot with
par(new=T) and label axis 4 with standard graphics. I've seen an example
for doing something similar in xyplot even though Deepayan has indicated
that lattice isn't the right
2006 Jan 16
1
label of second y-axis in xyplot (lattice)
Dear group,
First I provide you with an example, I found in the newsgroup. Then I'd like to explain my problem to you by means of the output.
enviro <-
data.frame(Year = rep(2001:2002, each = 365),
Day = rep(1:365, 2),
Precip = pmax(0, rnorm(365 * 2)),
Temp = 2 + 0.2 * rnorm(365 * 2))
xyplot(Precip + Temp ~ Day | Year,
2005 Nov 12
1
Updating in attempt to rotate ylab
What am I doing wrong? (please cc me when replying)
yy <- 1:10
xx <- yy*2
xYplot(yy~xx,ylab="") #this plots as it should
text(.4,5,expression(paste(log, frac(p(b),p(a)) )))
Error in text.default(0.4, 13, expression(paste(log, frac(p(b), p
(a))))) :
plot.new has not been called yet
This is the case even when I write:
xxyy <- xYplot(yy~xx,ylab="")
xxyy <-
2010 Jan 10
3
How to control spaces between axis, tick and label in xyplot or xYplot?
Dear R users,
I encounter a problem regarding space control in xyplot. Basically, I want
to control spaces between label, tick and axis. I remember there is a
function called mgp in general plot. Is there a similar function for xyplot
or xYplot?
Below is my basic code:
myplotkid<-xyplot(expected_offspringnumber~afr|decade,groups=SES,data1,
2011 Jul 27
2
Creating a flat legend 'grob' for lattice xyplot
Hi,
I want my xyplot legend to be flat, not tall, and there seems to be no way
for xyplot's auto.key and key elements to do this: I tried many, many
permutations of what I could find in the archives and reading the
documentation. If there there's a way to make it flat, please tell me what
the magic incantation is.
Here's a simple example of what I like to see. The xyplot will be a
2009 Sep 19
1
matrix operations on grobs and grid units
Dear list,
As a minimal test of a more complex grid layout, I'm trying to find a
clean and efficient way to arrange text grobs in a rectangular layout.
The labels may be expressions, or text with a fontsize different of
the default, which means that the cell sizes should probably be
calculated using grobWidth() and grobHeight() as opposed to simpler
stringWidth() and stringHeight().
2009 Sep 09
1
Xyplot, multi line title via main, all lines left justified
All,
Below is an xyplot plot with multiple panels and a title produced via main:
library("lattic")
data.ex = data.frame(y = rnorm(10), t = rep(1:5, 2), group = rep(c(0,1),
each = 5))
xyplot(y ~ t | as.factor(group), data = data.ex,
main = list("Put figure caption here xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
want this line left justified" ))
I must be mis-interpreting the
2010 Apr 28
1
Multiple cex sizes in main for xyplot?
Folks:
I would like to write two lines of text in two different font sizes (or
faces or ...) as the title ("main") of a trellis plot. The following code
does it, but not well:
xyplot((0:1)~(0:1),
main = textGrob(lab=c("Some Text","Some More Text"),y=c(.95,.8),
gp=gpar(cex=c(1.2,1.0)))
)
There is too much space between the title text and the plot. I assume
2005 Feb 24
1
Place more than one key with xyplot
Dear R-users
I have some trouble to generate more than one key with xyplot using the
legend argument.
I would like one key with rectangles:
library(lattice)
library(grid)
key1 <- list(rectangles = list(col= c(rev(heat.colors(5))[1:5],
rev(heat.colors(5))[4:1])),
title="Percentiles",
space="right",
2005 Oct 03
1
Grid: constructing a gTree with grobs that use named viewports from a vpTree
I'm trying to create a layout with named viewports that I can use for
other functions. I create the viewport tree that I want, and a list
of grobs with the viewports describing where they should go.
library(grid)
vp <- vpTree(
viewport(layout=grid.layout(2,2), name="layout"),
children=vpList(
viewport(layout.pos.col = 1, layout.pos.row=1, name="tl"),
2006 Dec 15
1
xyplot: legend title + legend on 1 line
Does anybody know how in xyplot to put the legend title on one line with the
legend? I can get the legend on one line with columns=... but the title is
always on top. I tried a custom key with key=... and text=... but I can't
put the title text in front of the plotting symbol.
I am looking for the following layout of the legend, on one line:
"Legend Title:" + plot symbol1 + legend
2004 Aug 03
3
dots expansion
Hi list,
I'm trying to write a function similar to rbind, except that needs to
add a factor to each component array before rbinding them together so
that the rows from different arrays are distinguishable.
The problem that arose is how to loop through arguments in the dots
"..." list. I need to get a hand on each of them but don't know how many
of them there are and what
2009 May 08
1
centering axis labels in lattice
Hello,
I'm attempting to alter the location of text in my axis labels in
lattice plots and have been unsuccessful so far. For example, the
y-axis labels are always right-justified, but I would like them to be
horizontally centered.
Here's an example:
library(lattice);
# create fake dataset to plot
to.plot <- data.frame(
x = 1:5,
y = c("1\nAAA", "2\nBBB",
2008 Jan 12
2
Lattice equivalent of par(mfrow = )
Dear r-helpers,
Does anyone have a straightforward example of putting together three
unrelated (expect for a common y-axis) xyplot() figures in what would
be in base graphics a par(mfrow = c(1, 3)) arrangement?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102