[R] legend font
murdoch at stats.uwo.ca
Wed Feb 14 21:19:31 CET 2007
On 2/14/2007 3:12 PM, Tyler Smith wrote:
> On Wed, Feb 14, 2007 at 02:40:47PM -0500, Duncan Murdoch wrote:
>> On 2/14/2007 1:32 PM, Tyler Smith wrote:
>> >I'd like to make the text in my legends italic,
>> >How can I do this?
>> This should work:
>> savefont <- par(font=3)
>> legend("topright", legend=c('Label 1', 'Label 2'), pch=1:2)
> Thanks! I don't understand it yet, but it does indeed work.
The idea is that the first par() command changes the default font for
everything. (The legend() function doesn't pass any font request down to
the graphics system, it just uses the default font.) It also returns
the old font setting and I saved it in "savefont".
The second par() call restores the old font setting.
More information about the R-help