Displaying 20 results from an estimated 1000 matches similar to: "Splitting device for ggplots?"
2008 Oct 27
3
Arrays of Trellis plots
hello,
the example below does not work. (i know it's not supposed, but it makes it
clear what i'm trying to achieve)
par(mfrow=c(2,1))
xyplot(y~x2|x1,data=dataframe1,pch=20)
xyplot(y~x2|x1,data=dataframe2,pch=20)
i know i could probably merge the two datasets and do something like
xyplot(y~x2|x1+dataset,data=merged)
any other suggestion?
thanks.
[[alternative HTML version deleted]]
2008 Dec 02
4
Bug in "transform"?
Dear useRs,
Here is a weird behavior of transform function:
mtcars1<-matcars
transform(mtcars1,t1=3,t2=4)
Error in data.frame(`_data`, e[!matched]) :
arguments imply differing number of rows: 32, 1
instead, this works:
mtcars1$t1<-0
transform(mtcars1,t1=3,t2=4)
also works if applied in turn:
transform(mtcars1,t1=3)
transform(mtcars1,t2=4)
I often need to use this
2008 Aug 08
2
gridBase and new.page() / grid.newpage()
Hello all,
I'm trying to write a function using the gridBase package. I'd like
to push several base subplots to a larger plot constructed with grid.
However, I'm having trouble getting consistent results when running
the function when the plotting window (quartz) is closed, when it is
left open and the plot function is repeated to the same window, and
when the output is saved to a
2005 May 31
2
Problem going back to a viewport with gridBase
I am setting up base plots -- one in viewport A and and one in B. This part
works fine. But if I go back to A after having done B and add
horizontal lines it seems
to not use the correct coordinates. How do I tell it to resume using A's
coordinates? I am already using par(fig = gridFIG()) but it seems that that's
not enough to reestablish them. What happens is that when I go back to
2005 May 31
2
Problem going back to a viewport with gridBase
I am setting up base plots -- one in viewport A and and one in B. This part
works fine. But if I go back to A after having done B and add
horizontal lines it seems
to not use the correct coordinates. How do I tell it to resume using A's
coordinates? I am already using par(fig = gridFIG()) but it seems that that's
not enough to reestablish them. What happens is that when I go back to
2009 Aug 28
1
names<- in data.frame (PR#13916)
Full_Name: Spinu Vitalie
Version: 2.9.0
OS: Windows
Submission from: (NULL) (130.115.113.15)
In assignment of "zero length" names to data.frame:
> tdf <- data.frame(rbind(c(1, 2), c(1, 2)))
> names(tdf) <- c("", "")
> tdf
structure(c("1", "1"), class = "AsIs") structure(c("2", "2"), class =
2006 Jun 12
1
strange behaviour with rotated viewports in grid
Dear all,
I am having a problem using grid when rotating a viewport. It seems
to plot everything on a grey background colour which I am not able to
get rid of. Even book examples such as that that plot figure 5.10 in
P. Murrell's R Graphics book show the same behaviour.
The following example illustrates this issue. I would appreciate if
anyone has a way to solve this.
Best regards,
2011 Oct 31
1
Help combining cell labelling and multiple mosaic plots
Dear colleagues
I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables).
When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out exactly as I'd like: side-by-side.
But I do require the cell labelling and the pop=FALSE
2006 May 21
1
print.trellis(..., draw.in=...)
A year ago I had posted this code
https://stat.ethz.ch/pipermail/r-devel/2005-June/033508.html
and the associated discussion was that there would be a print.trellis
argument that could be used to eliminate the need for with.vpPath
or with.viewport there. I assume that that is what draw.in= in
print.trellis is for. When I try it I get an error. I did notice that
?print.trellis says draw.in=
2008 Dec 01
2
align two lattice plots with grid
Dear list,
I need to align two plots on top of each other for comparison (they
only have the x-axis in common). When the y-labels have a different
extent, I cannot find a way to align the x-axes, as illustrated below,
> library(grid)
> library(lattice)
> x <- seq(0, 10, length=100)
> y <- sin(x)
> y2 <- 10*sin(x)
> f <- rep(c("1", "2"),
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
heights=unit(c(0.8, 8, 0.8, 8, 1.5), "cm"))
if(FALSE) grid.show.layout(gl)
2008 Jun 11
1
Problem when combining dotplot() and textplot() using grid
Hi everyone.
I want to solve the following problem. I have a data.frame and I
create a dotplot using lattice.
Then I want to use the grid-package to create a combined graphic which
contains the dotplot as well as a textplot() (using package gplots) of
the data.frame next to the dotplot.
Example code:
library(lattice)
library(grid)
library(gplots)
xx <- data.frame(f=factor(rep(1:5, each=5)),
2012 Mar 21
2
enableJIT() prohibits usual R debugging
Hi,
Browser doesn't work properly with the compiler enabled. It might be
intended behavior, but it's not documented.
compiler::enableJIT(1)
foo <- function(){
browser()
cat("here\n")
}
Browser doesn't stop, and I am getting:
> foo()
Called from: foo()
Browse[1]> here
>
Thanks,
Vitalie.
> sessionInfo()
R version 2.14.2 (2012-02-29)
Platform:
2009 Jun 23
2
curvedarrow (some graphics problem)
Hi there,
I just wonder how to draw this kind of picture...
http://www.nabble.com/file/p24158796/b.jpg
http://www.nabble.com/file/p24158796/a.jpg
and this is what i have done
%%%%%
library(shape)
library(diagram)
curve(sin(x),bty="n",-8,8,yaxt="n",ylab="",xaxt="n",type="n",xlab="")
axis(1,labels=F,at=seq(-8,8,1))
2006 Sep 09
1
How to rotate any plot in R
Dear all R users,
I am wondering whether it is possible in R to rotate any plot like Histogram, scatter plot, correlogram etc along with their legend, comments etc.
Thanks and regrads,
stat
---------------------------------
Find out what India is talking about on - Yahoo! Answers India
[[alternative HTML version deleted]]
2011 May 01
1
multiple mosaic plots layout
I would like to display multiple mosaic plots from vcd (not defined by a model but derived from different data sets)
side by side.
Neither par(mfrow=...)
nor layout seem to allow to arrange multiple mosaic plots in a grid.
Is there an easy way of arranging mosaics in a grid?
2009 May 21
1
size of point symbols
Dear list,
This might be a topic for r-devel but i may be missing something
obvious.
I don't understand the rationale in the absolute sizes of the point
symbols, and I couldn't find it documented. The example below uses
Grid to check the size of the symbols against a square of 10mm x 10mm.
> checkOneSymbol <- function(pch=0){
> gTree(children=gList(
>
2009 May 21
1
size of point symbols
Dear list,
This might be a topic for r-devel but i may be missing something
obvious.
I don't understand the rationale in the absolute sizes of the point
symbols, and I couldn't find it documented. The example below uses
Grid to check the size of the symbols against a square of 10mm x 10mm.
> checkOneSymbol <- function(pch=0){
> gTree(children=gList(
>
2012 Oct 19
1
grid(Base): How to avoid "Figure region too small and/or viewport too large" by specifying 'relative' units?
Dear grid-expeRts,
The goal:
I would like to construct a plot (matrix) with grid and gridBase,
which consists of four "sub-plots". The sub-plots should have a square plotting
region as one would force with par(pty="s") in base graphics.
The problem:
I don't get a square plotting region, not even by specifying
pty="s" in par(). Indeed, if you display the grid
2006 Sep 05
4
Two submitted packages
## This example runs in R 2.3.1 and does not run in R 2.4.1. I am
## raising it here for two questions: one on how to debug functions
## inside a namespace, the other on how to control clipping.
tmp <- data.frame(x=1:5, y=1:5, a=factor(c(1,1,1,1,1), levels=1:4))
xyplot(y ~ x,
data=tmp, ylim=c(1.5,4.5),
panel=function(x,y, ...) {
cpv <- current.viewport()