Hi Dieter:

 

See if this approach (below) to adjusting legend contents works for you.

 

Note how family and font apply only to the legend.

 

Best wishes.

 

Tom

 

#################################################

# Histogram of the Summary Object Variable with #

# an Added fivenum() Output in a Legend         #

#################################################

 

hist(AgChem.table$Larvae,                               

  main="Histogram of Larvae Counts, With fivenum()

  Output:  Minimum, 1Q, Median,

  3Q, Maximum",                                         

  xlab="Larvae Counts (Limit = 0 to 180)",              

  xlim=c(120,160),  # Scale adjusted for presentation.  

  ylim=c(0,50),     # Scale adjusted for presentation.  

  font.lab=2,                                           

  font.axis=2,                                          

  border="blue",                                        

  col="red",                                            

  nclass=50,                                            

  freq=TRUE,                                            

  prob=FALSE)                                           

  axis(side=1,                                          

    line=-0.1,                                          

    at=fivenum(AgChem.table$Larvae)[1:5],               

    lwd=1,                                              

    tick=TRUE,                                          

    font=2,                                             

    labels=c("Minimum", "1Q","Median","3Q", "Maximum"), 

    cex.axis=1.05,                                      

    col.axis="black",                                   

    padj=-2.9)                                          

savefamily   <- par(family="mono") # Courier font       

savefont     <- par(font=2)        # Bold               

legend("topright",                                      

  legend = c(                                           

  "Tukey's five number summary",       

  "==================================",

  "> fivenum(AgChem.table$Larvae)    ",

  "[1] 122.0 135.5 138.0 140.0 156.0 ",

  "----------------------------------",

  "122.0  Minimum                    ",

  "135.5  Lower-Hinge (1Q)           ",

  "138.0  Median                     ",

  "140.0  Upper-Hinge (3Q)           ",

  "156.0  Maximum                    ",

  "----------------------------------"),

    ncol=1,             

    locator(1),         

    xjust=1,            

    text.col="black",   

    cex=1.15,           

    inset=0.025,        

    bty="n")            

par(savefamily)         

par(savefont)           

  # The legend for this figure is rather large.  

  # It was set to a Courier-type mono-spaced font

  # to have all fivenum() function values and    

  # character values line up properly.           

 

 

 

Date: Sun, 10 Jul 2011 03:16:00 -0700 (PDT)

From: dmeire <dieter.me...@ugent.be>

To: r-help@r-project.org

Subject: [R] change legend character size in image.plot

Message-ID: <1310292960960-3657423.p...@n4.nabble.com>

Content-Type: text/plain; charset=us-ascii

 

I'm using the image.plot() function (fields package), but I want to enlarge

the characters of the legend (as they are too small to be read in a combined

figure), but there is no way I can find a command to do this. I can enlarge

the legend bar (with legend.witdh), axis character size (cex.axis)  or the

total legend size (legend.shrink), but not the character size of the legend

characters itself (and only that). Is it possible to do it in one or another

way?

 

Regards,

Dieter

 

--

View this message in context:
http://r.789695.n4.nabble.com/change-legend-character-size-in-image-plot-tp3
657423p3657423.html

Sent from the R help mailing list archive at Nabble.com.

 

 

Thomas W. MacFarland, Ed.D.
Senior Research Associate; Institutional Effectiveness and Associate
Professor
Nova Southeastern University
Voice 954-262-5395  Fax 954-262-3970   <mailto:tom...@nsu.nova.edu>
tom...@nsu.nova.edu

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to