similar to: plotmath: paste string and expression [from a vector of expressions]

Displaying 20 results from an estimated 10000 matches similar to: "plotmath: paste string and expression [from a vector of expressions]"

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
2006 Mar 06
3
how to make plotmath expression work together with paste
Recent questions about using plotmath have renewed my interest in this question I want to have expressions take values of variables from the environment. I am able to use expressions, and I am able to use paste to put text and values of variables into plots. But the two things just won't work together. Here is some example code that shows what I mean. plot(NA,xlim=c(0,100),ylim=c(0,100))
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 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
2020 Mar 27
2
Expressions from boxplot() passed to bxp()
Hi, Is this expected behavior (R-3.6.0)? dat <- cbind(x = 1:10, y = 10:1) ylab <- substitute(X[t], list(t = 2)) plot(dat, ylab = ylab) # works (correctly displays ylab) boxplot(dat, ylab = ylab) # fails boxplot(dat, ylab = as.expression(ylab)) # works Thanks & cheers, M
2011 Apr 01
1
How to paste a vector of expressions and a character vector?
Dear expeRts, I know I can't paste expressions in the normal way, but I just couldn't figure out how to get the following (I want to paste a character vector to an expression vector) right with bquote() or substitute. vec1 <- c("a", expression(tilde(b)), "c") vec2 <- c("1", "2", "3") main <- as.expression(paste(vec1, vec2))
2009 Oct 24
1
dev.copy(postscript,...) generates a disrupted string
Dear R-Users, I have the following problem: I would like to create a postscript file containing an r-plot with the string "\\vartheta" in it (reason: this is later converted to the TeX-string "\vartheta" and a vartheta is printed in the figure). In the minimal example below, the problem is that the created postscript file does _not_ contain the string "\\vartheta
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 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
2012 Oct 05
1
Format of numbers in plotmath expressions.
I want to do something like: TH <- sprintf("%1.1f",c(0.3,0.5,0.7,0.9,1)) plot(1:10) legend("bottomright",pch=1:5,legend=parse(text=paste("theta ==",TH))) Notice that the final "1" comes out in the legend as just plain "1" and NOT as "1.0" although TH is [1] "0.3" "0.5" "0.7" "0.9"
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2006 Jul 25
5
greek letters, text, and values in labels
Hello, I want to have a title that will look something like: "Results for \theta=2.1", given that I have a variable theta=2.1, and \theta should show on the screen like the greek letter. I've tried a lot of things: theta <- 2.1 plot(1:10, main=expression(paste("Results for", theta, "=", eval(theta)))) or using bquote plot(1:10, main=paste("Results for
2011 Sep 19
1
Possible or not possible: serif axis labels with plotmath [but everything else sans serif]?
Dear expeRts, I it possible to have serif labels in the following plot? x <- 1:10 y <- x plot(x, y, type="b", xlab=expression(x[1]), ylab=expression(x[2])) I know that one can use pdf(, family="serif"), but then also the axis tick marks are printed in serif font. Apart from the fact that it may not look nice, I'm just interested if one can have serif axis labels
2011 Mar 26
1
bwplot: how to get plotmath labels?
Dear expeRts, How can I get plotmath-labels in the bwplot below? As you can see, I couldn't manage to pass the expressions through the dimnames argument. Cheers, Marius library(lattice) ## data dim <- c(100, 6, 2, 3) dimnames <- list(n=paste("n=", seq_len(100), sep=""), groups=paste("group=", seq_len(6), sep=""),
2005 Aug 14
1
complex expression with plotmath
Hello everyone, I want to define a function that receives the name of two variables (may include Greek letters and subscripts) and uses them into the title of a plot. My best attempt is the following: myplot <- function(var1, var2) { v=paste(var1,"==1 & ",var2,"==2"); plot(1:10, main=parse(,,v)) } But when I call it with something like myplot("Q[i]",
2011 Jul 08
1
lattice: How to vertically adjust an axis label?
Dear expeRts, How can I vertically adjust an axis tick label so that it is nicely aligned with the other labels? library(lattice) xyplot(0~0, xlim=c(0,3), scales=list(x=list(at=c(1,1.1), labels=c(expression(hat(theta)[italic(n)]),expression(theta))))) ## aim: move the leftmost expression up so that theta is nicely aligned with the second theta. Cheers, Marius
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
2011 Sep 09
1
Rgl and plotmath symbols (via sprites): a trial
Dear all, Below is some code where I try to get plotmath symbols in an rgl plot. Duncan Murdoch kindly suggested to use a "sprite" for this. As you can see, on can get it to work, but my knowledge about grid and rgl is too limited to perfectly solve the problem. 1) As you can see (please rotate the plot a little bit so that (0,0,0) is "in front"), the quality of the .png
2007 Nov 15
2
Using plotmath expressions in lattice key text
Folks: delta <- 1:5 I would like to put 5 separate lines of text of the form "10 %+-% delta[i]" into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol and delta[i] is the ith value of delta. The construct: lapply(delta,function(d)bquote(10%+-%.(d))) appears to produce a list of expressions of the correct form, and, indeed, if I assign the above
2012 Mar 16
2
variable values in plotmath expressions
## I would like help in using variable values in plotmath expressions ## in lattice x <- 1:10 y <- 1:10 pval <- .95 plot(y ~ x, ## works as I want in base graphics main=substitute(list(alpha * " = " * group("",list(p),"")), list(p=pval))) plot(y ~ x, ## doesn't work as intended: "pval" is displayed main=substitute(list(alpha *