Skip to content
Prev 173295 / 398506 Next

North Arrow (.png file) on a Map

Is this "arrow" satisfactory for you?

north.arrow = function(x, y, h) {
    polygon(c(x, x, x + h/2), c(y - h, y, y - (1 + sqrt(3)/2) * h),
col = "black", border = NA)
    polygon(c(x, x + h/2, x, x - h/2), c(y - h, y - (1 + sqrt(3)/2) *
h, y, y - (1 + sqrt(3)/2) * h))
    text(x, y, "N", adj = c(0.5, 0), cex = 4)
}
plot(1, type = "n", ylim = c(0, 1))
north.arrow(1, 0.8, 0.3)

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China
On Tue, Mar 10, 2009 at 7:21 PM, Rodrigo Aluizio <r.aluizio at gmail.com> wrote: