Questions tagged [plotmath]

plotmath provides mathematical expression plotting in the R language.

Arguments to the text plotting functions in (text, mtext, axis, legend) accept both character and expression arguments. Character values are drawn to the plot as-is, while expressions are evaluated according plotmath rules. These rules differ from those for typical R expressions (see documentation).

169 questions
0
votes
1 answer

In R using a variable in plotmat used in mtext() on histogram

m <- mean(outcome[, 11], na.rm = TRUE) hist(df[, 11], main = "",xlab="", ylab="", xlim = c(0,as.integer(range(df[,11], na.rm=TRUE))[-1]), axes = FALSE) axis(side = 1, at = c(10,15,20)) axis(side = 2, at = c(0,200,400,600),…
0
votes
1 answer

Concatenate strings and results in R plotmath

In R, I want to include a legend in a plot with the result of the Spearman's rho. I use this: expression(paste(rho, " = ", cor(v$V1, v$V2, method = 'spearman'))) But in the legend I get: p = cor($(v,V1), $(v,V2), spearman) How can I get the result…
Medical physicist
  • 2,510
  • 4
  • 34
  • 51
0
votes
1 answer

Labels with correct indices and values

I would like to set labels: it should be always "n" (for the number of observations) but with correct indices and values for each plot element. For example, in the following simple…
DatamineR
  • 10,428
  • 3
  • 25
  • 45
-1
votes
1 answer

Having latex-like math formula in the legend

I know how to generate this in the legend: N_{1}(\alpha) which can be done via expression(N[1](alpha)) But I need something like this in latex: N_{1+}(\LargerCdot \alpha) which I have no clue how to generate.
user3639557
  • 4,791
  • 6
  • 30
  • 55
1 2 3
11
12