similar to: how to print a colored plot in black/white?

Displaying 20 results from an estimated 6000 matches similar to: "how to print a colored plot in black/white?"

2010 Nov 26
3
lattice: strange behavior (?) when using trellis.device(color=FALSE)
Dear expeRts, I am not sure if I found a bug... I would like to create a function that itself creates a lattice plot without colors. Following http://www.mail-archive.com/r-help at r-project.org/msg64699.html I use trellis.device() to set the colors to FALSE. Whenever I call the minimal example below *with* trellis.device(), Quartz opens a window (I am working on a MAC), which it shouldn't,
2008 Jan 01
2
Alignment and Labeling of a color key in a xyplot?
Happy New Year to all R users! I have two short questions concerning a xyplot with a color key: 1) How do I properly place (align) the color key beside the xyplot? As you can see from the code listed below, the placement of the color key is not correct. I would like the upper and lower end point of the color key to be perfectly aligned with the upper and lower line of the xyplot. Adjusting
2011 Feb 25
1
plotmath: how to create a vector of expressions?
Dear expeRts, I would like to use LaTeX-like symbols in keys via plotmath. Below is a minimal example. I get: Error in fun(key = list(x = 0.5, y = 0.8, text = list(list(expression(paste("(", : first component of text must be vector of labels What's wrong? How can I create the required vector (of expressions)? Cheers, Marius library(lattice) val <- matrix(1, nrow = 10, ncol
2011 Apr 18
4
splom, plotmath: how to add three lines of information with alignment?
Dear expeRts, I would like to create a scatter plot matrix with splom(). The lower panel should contain some additional information about the samples shown in the upper panel plot, see the splom() call below. Now two questions came up: (1) The lower panels show "tau" and "alpha" on top of each other. How can I plot *three* expressions on top of each other? I tried several
2010 Nov 13
3
How to set an argument such that a function treats it as missing?
Dear expeRts, I would like to call a function f from a function g with or without an argument. I use missing() to check if the argument is given. If it is not given, can I set it to anything such that the following function call (to f) behaves as if the argument isn't given? It's probably best described by a minimal example (see below). The reason why I want to do this is, that I do
2006 May 29
3
mtext in trellis-loop & colorkey
Hello, I would like to create a sequence of plots (using a for loop). I read in the FAQ that print() has to be used in order to obtain any output. This works perfectly fine as long as I only consider one function call in the loop, but I would like to add mtext() to the each plot in the loop. Unfortunately, this did not work. Any suggestions? As you can see from the provided example,
2011 Apr 06
7
Quiz: Who finds the nicest form of X_1^\prime?
Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=expression(italic(X[1]*minute))) plot(0,0,main=expression(italic(X)[1]*minute)) Any suggestions? Cheers, Marius
2010 Dec 29
2
How to create an array of lists of multiple components?
Hi, how can I create an array of lists of three components? This approach does not work: n1 <- 2 n2 <- 4 n3 <- 5 res <- array(rep(vector("list",3), n1*n2*n3), dim = c(n1,n2,n3)) res[1,1,1] # is not a list with three components... The goal is that res[1,1,1] is a list with three components. Also, appending the components didn't work. For example, I tried: component
2006 Feb 12
1
contour lines for levelplot
Hi, I would like to add contour lines to a (trellis/lattice-) levelplot. Sure, there is the "contour=TRUE" argument, but this uses "cuts=..." (which is usually chosen very high for my plots. I guess cuts=99 is the best you can do (?)) for plotting the contour lines. Furthermore, I do not like the numbering of the contour lines this way. Therefore, I tried to add a
2010 Dec 30
1
latex() etc.: How to nicely format a matrix for a LaTeX document?
Dear (T)eXpeRts, I try to create a LaTeX table from an R matrix for the first time. I am not sure what the "best" approach is, I just read about latex() from Hmisc (toLatex() didn't work). Consider the following minimal example: library(Hmisc) mat <- matrix(c(1,NA,3,100,10000,4), ncol = 3, byrow = TRUE) latex(mat, file = "", booktabs = TRUE, numeric.dollar = FALSE,
2006 Mar 04
5
Remove "gray grid" from levelplot
Hi, If I use the levelplot function of the lattice library, I always see small "squares" in the plot. They indicate the region for which the same color is used. If you have a levelplot of a function which is evaluated at 25x25 equally-spaced points you obtain 26 squares in x and 26 squares in y direction. That does not bother too much (but still bothers somehow...), but if you
2011 Jun 02
2
lattice + plotmath: how to get a variable in bold face?
Dear all, How can I get a bold "1000" in the title? I would like to use a variable (as opposed to putting in "1000" directly). library(lattice) N <- 1000 xyplot(0~0, xlab.top=list(label=as.expression(bquote(bold("foo" ~ .(N) ~ "bar"))), font=2, cex=1.2)) ## => "font=2" is ignored (of course) Cheers, Marius
2011 Sep 09
1
rgl: axis/viewport/box problems in persp3d()
Dear expeRts, I am a new user of rgl, below is my first trial to plot a simple function in 3d. I managed to put the axes in the right locations, but: (1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes labels? (2) Since I removed the axes in persp3d() the viewport is too small; is it possible to keep the size of the viewport? (3) The box is not correctly drawn, there
2010 Dec 21
1
How to suppress plotting for "xyplot(zoo(x))"?
Hi, I found the thread http://r.789695.n4.nabble.com/Matrix-as-input-to-xyplot-lattice-proper-extended-formula-syntax-td896948.html I used Gabor's approach and then tried to assign the plot to a variable (see below). But a Quartz device is opened... why? I don't want to have anything plot/printed, I just would like to store the plot object. Is there something like "plot =
2011 Jun 02
2
plotmath: paste string and expression [from a vector of expressions]
Dear all, I have a vector of expressions and would like to "paste" some string to it before using it in a plot: vars <- vector("expression", 2) vars[1] <- expression(alpha) vars[2] <- expression(beta) plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) )) Although I tried hard, I just can't figure out how to solve this. The title should be
2010 Dec 22
3
How to integrate a function with additional argument being a vector or matrix?
Dear expeRts, I somehow don't see why the following does not work: integrand <- function(x, vec, mat, val) 1 # dummy return value A <- matrix(runif(16), ncol = 4) u <- c(0.4, 0.1, 0.2, 0.3) integrand(0.3, u, A, 4) integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4) I would like to integrate a function ("integrand") which gets an "x" value (the
2011 Jun 02
1
[R-SIG-Mac] check leads to .o files and to packagename-Ex.R
On 06/02/2011 06:47 AM, Benilton Carvalho wrote: > 'R CMD check' should be applied on the .tar.gz, not on the source directory. Why? The help says: "Check R packages from package sources, which can be directories or package 'tar' archives with extension '.tar.gz', '.tar.bz2' or '.tgz'." I just skimmed through the relevant section (1.3.1) in
2010 Dec 26
1
lattice splom: how to adjust space between tick marks and tick labels?
Dear expeRts, how can I decrease the space between the tick marks and the corresponding labels in an splom? See here: library(lattice) U <- matrix(runif(4000), ncol = 8) splom(U, axis.text.cex = 0.2) # => space between the [small] tick labels and tick marks is/seems to be too large I checked ?panel.pairs but could not find an option for that. Cheers, Marius
2011 Jun 21
2
Tricky (?) conversion from data.frame to matrix where not all pairs exist
Dear expeRts, In the minimal example below, I have a data.frame containing three "blocks" of years (the years are subsets of 2000 to 2002). For each year and block a certain "value" is given. I would like to create a matrix that has row names given by all years ("2000", "2001", "2002"), and column names given by all blocks ("a",
2010 Nov 26
1
How to use expression(italic()) in a "vectorized" way (within a function)?
Dear expeRts, I would like to use expression() for creating labels in a splom, as shown in the first minimal example below. Is there any way I can simplify having to write "expression(italic(...))" several times? The second example is what I tried so far, but I can't manage to get italic() to work. Moreover, it still seems bulky... Cheers, Marius ## minimal example (working but