Variables and greek letters in a plot title

7 messages
Open this post in threaded view
|
Report Content as Inappropriate

Variables and greek letters in a plot title

 Hello This is a problem I encountered repeatedly and I found no answer that made me really happy. I hope it is not too trivial. I would like to give the concentration of a substance in a plot title: 5 ug/ml substance the '5' would be a variable and the ug should be micrograms (with greek letter mu). It is the mu that causes the problems for me. I failed using various combinations of paste, expression and bquote. I would be very grateful if someone could help me (or point me to the solution, which I might have overlooked). Thank you very much Dominik -- Dominik Refardt Institute of Integrative Biology, ETH Zürich         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Variables and greek letters in a plot title

 Hi Dominik, You can try x <- 5 plot(rnorm(50), main=bquote(.(x) * mu * g/m^3 * " substance")) Regards, - Jon On Thu, Aug 16, 2012 at 3:37 PM, Dominik Refardt <[hidden email]> wrote: > Hello > > This is a problem I encountered repeatedly and I found no answer that made > me really happy. I hope it is not too trivial. > > I would like to give the concentration of a substance in a plot title: > > 5 ug/ml substance > > the '5' would be a variable and the ug should be micrograms (with greek > letter mu). It is the mu that causes the problems for me. I failed using > various combinations of paste, expression and bquote. I would be very > grateful if someone could help me (or point me to the solution, which I > might have overlooked). > > Thank you very much > > Dominik > > -- > Dominik Refardt > Institute of Integrative Biology, ETH Zürich > >         [[alternative HTML version deleted]] > > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Variables and greek letters in a plot title

 Thanks a lot. However it's not completely what I want. There is space missing between the variable and the mu. Can this be added? On Thu, Aug 16, 2012 at 12:09 PM, Miguel Manese <[hidden email]> wrote: > Hi Dominik, > > You can try > > x <- 5 > plot(rnorm(50), main=bquote(.(x) * mu * g/m^3 * " substance")) > > Regards, > > - Jon > > On Thu, Aug 16, 2012 at 3:37 PM, Dominik Refardt > <[hidden email]> wrote: > > Hello > > > > This is a problem I encountered repeatedly and I found no answer that > made > > me really happy. I hope it is not too trivial. > > > > I would like to give the concentration of a substance in a plot title: > > > > 5 ug/ml substance > > > > the '5' would be a variable and the ug should be micrograms (with greek > > letter mu). It is the mu that causes the problems for me. I failed using > > various combinations of paste, expression and bquote. I would be very > > grateful if someone could help me (or point me to the solution, which I > > might have overlooked). > > > > Thank you very much > > > > Dominik > > > > -- > > Dominik Refardt > > Institute of Integrative Biology, ETH Zürich > > > >         [[alternative HTML version deleted]] > > > > > > ______________________________________________ > > [hidden email] mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > > > -- Dominik Refardt Theoretical Biology Institute of Integrative Biology, ETH Zürich ETH Zentrum, CHN J11 Universitätsstrasse 16 CH-8092 Zürich Switzerland Phone: +41446327102 Fax: +41446321271 Email: [hidden email]         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Variables and greek letters in a plot title

 In reply to this post by Dominik Refardt > I would like to give the concentration of a substance in a plot title: > > 5 ug/ml substance Examples of including a variable in text are given in the ?plotmath page, under " ## How to combine "math" and numeric variables". For your case, plot(1:10) conc=5 title(main=bquote(.(conc)~mu*"g/ml substance")) works. S ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Variables and greek letters in a plot title

 In reply to this post by Dominik Refardt On Aug 16, 2012, at 09:37 , Dominik Refardt wrote: > Hello > > This is a problem I encountered repeatedly and I found no answer that made > me really happy. I hope it is not too trivial. > > I would like to give the concentration of a substance in a plot title: > > 5 ug/ml substance > > the '5' would be a variable and the ug should be micrograms (with greek > letter mu). It is the mu that causes the problems for me. I failed using > various combinations of paste, expression and bquote. I would be very > grateful if someone could help me (or point me to the solution, which I > might have overlooked). Like this? plot(0,0) conc <- 5 title(main=bquote(.(conc)*" "*mu*g/ml*" substance")) -- Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: [hidden email]  Priv: [hidden email] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Variables and greek letters in a plot title

 Thanks a lot. Both plot(1:10) conc=5 title(main=bquote(.(conc)~mu*"g/ml substance")) and plot(0,0) conc <- 5 title(main=bquote(.(conc)*" "*mu*g/ml*" substance")) do exactly what I need. On Thu, Aug 16, 2012 at 1:33 PM, peter dalgaard <[hidden email]> wrote: > > On Aug 16, 2012, at 09:37 , Dominik Refardt wrote: > > > Hello > > > > This is a problem I encountered repeatedly and I found no answer that > made > > me really happy. I hope it is not too trivial. > > > > I would like to give the concentration of a substance in a plot title: > > > > 5 ug/ml substance > > > > the '5' would be a variable and the ug should be micrograms (with greek > > letter mu). It is the mu that causes the problems for me. I failed using > > various combinations of paste, expression and bquote. I would be very > > grateful if someone could help me (or point me to the solution, which I > > might have overlooked). > > Like this? > > plot(0,0) > conc <- 5 > title(main=bquote(.(conc)*" "*mu*g/ml*" substance")) > > -- > Peter Dalgaard, Professor > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: [hidden email]  Priv: [hidden email] > > -- Dominik Refardt Theoretical Biology Institute of Integrative Biology, ETH Zürich ETH Zentrum, CHN J11 Universitätsstrasse 16 CH-8092 Zürich Switzerland Phone: +41446327102 Fax: +41446321271 Email: [hidden email]         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.