[R] How to plot an expression-label with variable text

David Winsemius dwinsemius at comcast.net
Fri Aug 27 20:58:34 CEST 2010


On Aug 27, 2010, at 2:28 PM, baptiste auguie wrote:

> hi,
>
> try this
>
> lab =bquote(paste("Estimated ", t[50]," from ",.(what)))

bquote doesn't need the paste() if you use plotmath separators:

lab =bquote(Estimated ~t[50]~from~.(what))
text(0.5,0.2,lab)

>
>
> HTH,
>
> baptiste
>
> On 27 August 2010 20:19, Dieter Menne <dieter.menne at menne-biomed.de>  
> wrote:
>>
>> plot.new()
>> lab =expression(paste("Estimated ", t[50]," from tgv"))
>> text(0.5,0.5,lab)
>> # Should look the same as above. I could not get the substitute  
>> right:
>> what = "tgv"
>> lab =expression(paste("Estimated ", t[50]," from ",what))
>> text(0.5,0.2,lab)
>>
-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list