[R] plotmath question

David Winsemius dwinsemius at comcast.net
Thu Aug 19 21:12:46 CEST 2010


On Aug 19, 2010, at 2:46 PM, array chip wrote:

> Thanks David!

I see that I didn't produce the "correct" answer, but perhaps I'm  
being thanked for something that was generalizable in that direction.  
Better would have ben one of these:

  plot(1, ylab= bquote(italic(P) *.(b)*","*~A)  )

  plot(1, ylab= bquote(paste(italic(P),.(b),",") ~ A)  )

In the second instance, paste() is a plotmath expression function,  
rather than the character vector function that lives out in the free- 
range R.

-- 
David.

> ----- Original Message ----
> From: David Winsemius <dwinsemius at comcast.net>
>
> On Aug 19, 2010, at 2:24 PM, array chip wrote:
>
>> Thanks, yes it worked!
>>
>> What about if I want to print as "P2, A" where A is just letter A
>> and 2 is from
>> variable b.
>
> ?plotmath
>
>  plot(1, ylab= bquote(italic(P) *","*.(b)~A)  )
>
>> John
>>
>> ----- Original Message ----
>> From: baptiste auguie <baptiste.auguie at googlemail.com>
>>
>> Try this,
>>
>> b = 20
>>
>> plot(1, ylab= bquote(italic(P) * .(b))  )
>>
>> HTH,
>>
>> baptiste
>>
>> On 19 August 2010 20:02, array chip <arrayprofile at yahoo.com> wrote:
>>> Hi all, let me give a simple example:
>>>
>>> b<-20
>>> I would like to print ylab as "P20" where "P" is printed in Italic
>>> font. When
>> I
>>> do the following:
>>>
>>> plot(1, ylab=expression(paste(italic("P"),b,sep="")))
>>>
>>> I got y axis label printed as "Pb" instead of "P20". What is the
>>> best solution
>>> to print platmath symbols with value of the variable at the same
>>> time?
>>>
>>> Thanks
>>>
>>> John
>

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list