0

either Im too stupid or it is not possible. For my plot check the following:

enter image description here

This is good already. However I need the labels on the x-Axis for the first and last element. This means, according to the plot the labels should go from c1m1 to c1m31. Can I achieve this? Im already substituting the labels with the axis command via "at" and "labels". The values in between the borders are not that important, but the range of the curve needs to be clear.

Thanks

Theodore Lytras
  • 3,955
  • 1
  • 18
  • 25
Richard A. Schäfer
  • 1,029
  • 1
  • 12
  • 18
  • 3
    Can you provide code that you have used and sample of your data? [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Didzis Elferts Jan 03 '13 at 14:13
  • 1
    If I understand your problem correctly, you just need to suppress the x-axis on your original `plot`, and then specify a label with `axis` only for the first and last element. Like this: `plot(1:100, xaxt="n"); axis(1, at=c(1,100), label=c("A","Z"))` – Theodore Lytras Jan 03 '13 at 14:47

1 Answers1

1

You will simply need to first plot the graph without x axis and then use the axis command to place labels where you want to

The following example shows how to use first and last element of an array

rainfall <- c(2, 5, 4, 5, 12)
days <- c("Mon","Tue","Wed","Thu","Fri")
plot (rainfall, xaxt="n")
axis(1, at=c(1,length(days)), lab=c(days[1], days[length(days)]))

will produce a plot with x labels only at the first and last data point. The key here is the xaxt="n" in plot command and the axis command on following line.

Pl. go through the tutorial at http://www.harding.edu/fmccown/r/

rputikar
  • 1,523
  • 13
  • 14