Resize plots to display axis labels
1
0
Entering edit mode
Anthony Bosco ▴ 500
@anthony-bosco-517
Last seen 10.2 years ago
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@ichr.uwa.edu.au
GO GO • 2.6k views
ADD COMMENT
0
Entering edit mode
@oosting-j-path-412
Last seen 10.2 years ago
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@ichr.uwa.edu.au] > Sent: donderdag 27 mei 2004 10:13 > To: bioconductor@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@ichr.uwa.edu.au > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT

Login before adding your answer.

Traffic: 851 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6