Hi, I have plot a graphics by next way: par(mar=c(5,5,1,1), font.axis=3, ps=14, xaxs="i", yaxs="i", lab=c(18,18,7), font .lab=3); plot(l, b, type="n", xlim=c(0,360), ylim=c(-90,90), xlab="l, deg", ylab="b, deg"); points(l, b, cex=vel/60, col=1, pch=21); On this plot I have axis x (denoted by l) ranged in [0,360] with labeling step 20. But I want to set this step equal to 60 and want to set format of labels to degrees. I'm newbie in R and don't know how to change parameters of axis. Especially important to add sign of degree to each tick label. Thanks in advance, -- --------------------------------------------------------------------------------------- Eugene A. Semenko e-mail: sea at sao.ru Special Astrophysical Observatory RAS, WWW: http://tiger.sao.ru/ Nizhnij Arkhyz phone: +7 87878 46 5 77 Karachai-Chercassian Republic, fax: +7 87878 46 5 27 Russia, 369167
On Sun, 2007-03-18 at 19:36 +0300, Eugene Semenko wrote:> Hi, > I have plot a graphics by next way: > par(mar=c(5,5,1,1), font.axis=3, ps=14, xaxs="i", yaxs="i", lab=c(18,18,7), > font > .lab=3); > plot(l, b, type="n", xlim=c(0,360), ylim=c(-90,90), xlab="l, deg", ylab="b, > deg"); > points(l, b, cex=vel/60, col=1, pch=21); > > On this plot I have axis x (denoted by l) ranged in [0,360] with labeling step > 20. But I want to set this step equal to 60 and want to set format of labels > to degrees. I'm newbie in R and don't know how to change parameters of axis. > Especially important to add sign of degree to each tick label. > Thanks in advance,Eugene, see ?plotmath for more information. at <- seq(-360, 360, 60) plot(at, at, axes = FALSE) # Now create expressions with the degree symbol # See ?parse and ?paste L <- parse(text = paste(at, "*degree", sep = ""))> Lexpression(-360 * degree, -300 * degree, -240 * degree, -180 * degree, -120 * degree, -60 * degree, 0 * degree, 60 * degree, 120 * degree, 180 * degree, 240 * degree, 300 * degree, 360 * degree) # now do the axis labels axis(1, at = at, labels = L, cex.axis = 0.75) axis(2, at = at, labels = L, cex.axis = 0.75, las = 2) See ?axis as well. HTH, Marc Schwartz
? ????????? ?? Sunday 18 March 2007 20:38 Marc Schwartz ???????(a):> Eugene, see ?plotmath for more information. > at <- seq(-360, 360, 60) > > plot(at, at, axes = FALSE) > > # Now create expressions with the degree symbol > # See ?parse and ?paste > L <- parse(text = paste(at, "*degree", sep = "")) > > > L > > expression(-360 * degree, -300 * degree, -240 * degree, -180 * > degree, -120 * degree, -60 * degree, 0 * degree, 60 * degree, > 120 * degree, 180 * degree, 240 * degree, 300 * degree, 360 * > degree) > > # now do the axis labels > axis(1, at = at, labels = L, cex.axis = 0.75) > > axis(2, at = at, labels = L, cex.axis = 0.75, las = 2) > > > See ?axis as well.Hi Mark. Thanks for operative answer. It works. -- --------------------------------------------------------------------------------------- Eugene A. Semenko e-mail: sea at sao.ru Special Astrophysical Observatory RAS, WWW: http://tiger.sao.ru/ Nizhnij Arkhyz phone: +7 87878 46 5 77 Karachai-Chercassian Republic, fax: +7 87878 46 5 27 Russia, 369167 cell: +7 928 810 48 61 ICQ: 167727721