1

I have two vectors alpha <- c(1,2,3), beta <- c(4,5,6). I have three plots and each of them is using diferent alpha and beta (etc. first plot contains alpha[1] and beta[1])

Now I would like to add axis title to each graph like: "alpha = 1, beta = 4" with greek letters. How can I do it? I found a similar question so I tried some solutions from there, but:

with bquote() I can use only one = . So I can do

bquote(alpha == .(alpha[1]) * ", " * beta * .(beta[1])) do get alpha = 1, beta4

but I can't add another =

with expression(paste()) variables works like text, so instead of alpha = 1, I got alpha = alpha[1]

What is a correct way how to do it?

Community
  • 1
  • 1
Marek Čačko
  • 980
  • 2
  • 21
  • 31

1 Answers1

1

I'd try using a plotmath list call:

plot(1,1, main= bquote(list( alpha == .(alpha[1]) ,  beta == .(beta[1])) )  )
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • Thanks to @user3502164 for trying to fix my error. I don't agree with the first reviewer. Since I also noticed the error and applied the same fix, I thought it was needed. The rationale that an edit must be "significant" means that even deleting a single "=" sign will be "significant" if it creates working code where erroneous code was offered before. – IRTFM Nov 24 '15 at 00:09