[R] Add text A, B, C and D on multiple ordered plot

Fabrice Tourre fabrice.ciup at gmail.com
Fri Feb 8 21:39:24 CET 2013


John Kane,

Thanks. It makes some of sense. But it seems not exactly what I want.
I just remember it need using mtext and adjust margin. I saw such of
example long time ago, but I have forgotten it.

On Fri, Feb 8, 2013 at 3:32 PM, John Kane <jrkrideau at inbox.com> wrote:
> Here is a rough example of what you want. You will need to adjust the actual placement by hand by redefining the x & y values.
>
> set.seed(100)
>   a <- rnorm(1000,0,1)
>   b <-rnorm(1000,0,2)
>   c <-rnorm(1000,0,3)
>   d <-rnorm(1000,0,4)
>    opr  <-  par(mfrow=c(2,2))
>   hist(a)
>   text(-3, 150, labels ="a")
>   hist(b)
>   text(-4, 150, labels ="b")
>   hist(c)
>   text(-4, 150, labels ="c")
>   hist(d)
>   text(-4, 150, labels ="d")
>
>   par  <-  opr
>
>
> John Kane
> Kingston ON Canada
>
>
>> -----Original Message-----
>> From: fabrice.ciup at gmail.com
>> Sent: Fri, 8 Feb 2013 14:42:10 -0500
>> To: jrkrideau at inbox.com
>> Subject: Re: [R] Add text A, B, C and D on multiple ordered plot
>>
>> Thank your reminder.
>> Here is the example code:
>>
>> a<- rnorm(1000,0,1)
>> b<-rnorm(1000,0,2)
>> c<-rnorm(1000,0,3)
>> d<-rnorm(1000,0,4)
>> par(mfrow=c(2,2))
>> hist(a)
>> hist(b)
>> hist(c)
>> hist(d)
>>
>> I want to add A, B, C and D on each top left.
>>
>> On Fri, Feb 8, 2013 at 2:35 PM, John Kane <jrkrideau at inbox.com> wrote:
>>> Yes there probably is if you would show us what you are doing.
>>> Minimal working code helps.
>>>
>>> https://github.com/hadley/devtools/wiki/Reproducibility
>>>
>>> John Kane
>>> Kingston ON Canada
>>>
>>>
>>>> -----Original Message-----
>>>> From: fabrice.ciup at gmail.com
>>>> Sent: Fri, 8 Feb 2013 14:28:17 -0500
>>>> To: r-help at r-project.org
>>>> Subject: [R] Add text A, B, C and D on multiple ordered plot
>>>>
>>>> Dear list,
>>>>
>>>> Is there a elegant way to name multiple ordered plot as A, B, C and D?
>>>> Just put A, B, C and D on the top left corner of each plot.
>>>>
>>>> Usually I do it in Illustrator, but I think in R should there is a way.
>>>>
>>>> Could you please provide a example?
>>>>
>>>> Thank you very much in advance.
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org 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.
>>>
>>> ____________________________________________________________
>>> FREE ONLINE PHOTOSHARING - Share your photos online with your friends
>>> and family!
>>> Visit http://www.inbox.com/photosharing to find out more!
>>>
>>> ______________________________________________
>>> R-help at r-project.org 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.
>
> ____________________________________________________________
> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
> Check it out at http://www.inbox.com/earth
>
>



More information about the R-help mailing list