[BioC] Resize plots to display axis labels

Oosting, J. (PATH) J.Oosting at lumc.nl
Thu May 27 10:28:45 CEST 2004


Within the plotting functions for the globaltest package we do it this
way...

legend is a vector of labels to print on the axis, which length is equal to
the x-dimension of the plot
labelsize is an argument for the function

if (is.null(labelsize))
  labelsize<-par("cex.axis")
plot.new()  
labwidth<-max(strwidth(legend,"inches",labelsize))
margins<-par("mai")
par(new=TRUE,"mai"=c(max(margins[1],labwidth*1.3),margins[2:4]))
plot( datatoplot , xlab = "", xaxt="n",...)
axis(1, 1:length(legend), legend, cex.axis = labelsize, las=2)
par("mai"=margins)


regards,

Jan

> -----Original Message-----
> From: Anthony Bosco [mailto:anthonyb at ichr.uwa.edu.au]
> Sent: donderdag 27 mei 2004 10:13
> To: bioconductor at stat.math.ethz.ch
> Subject: [BioC] Resize plots to display axis labels
> 
> 
> Hi.
> 
> I always have trouble with fitting certain plots in the viewing 
> window of R console.
> 
> Usually the problem is that the X axis labels (when they are text 
> such as GO terms or sample names) don't always fit in the plot window.
> 
> How can I adjust the x axis label size (cex.axis does not seem to 
> work) or position of plot in the window to always fit the entire text 
> of the x axis.
> 
> 
> Regards
> 
> 
> 
> Anthony
> -- 
> ______________________________________________
> 
> Anthony Bosco - PhD Student
> 
> Institute for Child Health Research
> (Company Limited by Guarantee ACN 009 278 755)
> Subiaco, Western Australia, 6008
> 
> Ph 61 8 9489  , Fax 61 8 9489 7700
> email anthonyb at ichr.uwa.edu.au
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor
>



More information about the Bioconductor mailing list