Re: [R] axis scaling problem

From: Marc Schwartz <>
Date: Fri 28 Oct 2005 - 22:56:11 EST

On Fri, 2005-10-28 at 10:27 +0200, Andreas Zankl wrote:
> On the attached figure, I had to use ylim (0,3) to have enough space
> for the labels to be plotted. However, the values on the y-axis are
> never bigger than 1, so the axis labeling does not make much sense.
> Can I only get y-axis tick marks at 0 and 1 but still have the
> additional plotting space for the labels?
> Thanks
> Andreas

Your attachment did not come through and without either reproducible code or the image, it would be difficult to provide specific recommendations.

However, things to consider:

  1. Reduce the size of the fonts for your axis labels to make more room. See ?par and note the cex.axis parameter.
  2. Consider using meaningful abbreviations for your labels to shorten them.
  3. Consider rotating the labels using par("las"). You will likely need to adjust the plot margins using par("mar") as well to make room for the rotated labels.
  4. See R FAQ 7.27 "How can I create rotated axis labels?" which is a method to enable axis labels rotated to something between horizontal and vertical (ie. 45 degrees).

HTH, Marc Schwartz mailing list PLEASE do read the posting guide! Received on Fri Oct 28 23:10:04 2005

This archive was generated by hypermail 2.1.8 : Sat 29 Oct 2005 - 00:13:02 EST