-2

I want to create a plot with ticks and labels above and to the right of the plot using axis(). How do I suppress the ticks and labels that 'automatically' print with the plot() function? Thank you

x<-1:10
y<-1:10

quartz("test")
par(mar=c(10,10,10,10)+0.1)#sets margins of plotting area
par(pty="s")#fixes the aspect ratio to 1:1

#Automatically adds ticks, numbers and axis labels. How can I avoid this?
plot(x,y,typ="n")

#Adds axes above and to the right of plot area...I want these only
axis(side=4,las=2, ylab="y label")
axis(side=3,las=1,xlab="x label")
agamesh
  • 539
  • 1
  • 10
  • 26
Elizabeth
  • 5,771
  • 16
  • 57
  • 88
  • 13
    some of your questions are pretty basic (we all start there) may I suggest you learn a few things about R if you are indeed new as I suspect: 1)use`?` followed by object for help; as in `?par` (type this in the command line) 2)use [rseek.org](http://www.rseek.org/) as this makes searching for R specific things easier 3) the package `sos` is great for searching for items of interest. To get it type `install.packages("sos")` and then use `findFn("topic of interest")`. This will help with many basic questions. 4)Sometimes a google search with `R` or `CRAN` at the begining is fruitful. – Tyler Rinker Sep 06 '12 at 16:38
  • 2
    Thank you for your advice. I am indeed fairly new but I am also in the final 20 days of writing up my dissertation. I do apologise for asking the occasion stupid question. A little empathy would be quite nice though as some previous replies to basic questions have been quite harsh (not yours though). – Elizabeth Sep 07 '12 at 08:15

1 Answers1

6

See ?plot.default:

plot(x, y, type="n", axes=FALSE, frame.plot=TRUE, xlab="", ylab="")
sgibb
  • 23,631
  • 1
  • 59
  • 67