1show.pch <- function(object=par('font')) 2{ 3 plot(0,0,xlim=c(-1,11),ylim=c(0,26),type='n',axes=FALSE,xlab='',ylab='') 4 j <- -1 5 for(i in 0:253) { 6 if(i %% 25==0) { 7 j <- j+1; 8 k <- 26 9 } 10 11 k <- k-1 12 points(j, k, pch=i, font=object) 13 text(j+.45, k, i) 14 } 15 16 invisible() 17} 18 19 20character.table <- function(font=1) 21{ 22 ## Prints numeric equivalents to all latin characters 23 ## Usage: graphsheet(orientation = "portrait") 24 ## character.table() 25 ## Print the resulting graphsheet. The printed version doesn't allways 26 ## corresponds to the screen display. The character on line "xy" and column "z" 27 ## of the table has code "xyz". 28 ## These codes can be used as any other characters. e.g. 29 ## title("\347\340 et \340") 30 ## As the command line window of Splus can't print special characters 31 ## cat("\347\340 et \340") 32 ## will not print the special characters, at least under 4.5 and under 2000. 33 ## 34 ## Author: 35 ## Pierre Joyet / Aktuariat pierre.joyet@bluewin.ch 36 37 v <- 40:377 38 v <- v[v %% 100 < 80 & v %% 10 < 8] 39 par(mar = c(5, 5, 4, 2) + 0.1) 40 plot(0:7, seq(4, 31, length = 8), type = "n", axes = FALSE, xlab = "", 41 ylab = "") 42 k <- 1 43 for(i in 4:31) 44 for(j in 0:7) { 45 text(j, 35 - i, eval(parse(text = paste("\"\\", v[k], "\"", 46 sep = ""))), font = font) 47 k <- k + 1 48 } 49 50 text(0:7, rep(33, 7), as.character(0:7), font = 3) 51 text(rep(-1, 28), 31:4, as.character(c(4:7, 10:17, 20:27, 30:37)), 52 font = 3) 53 invisible() 54} 55 56 57show.col <- function(object=NULL) 58{ 59 plot(0,0,xlim=c(-1,10),ylim=c(0,10),type='n',axes=FALSE,xlab='',ylab='') 60 j <- -1 61 for(i in 0:99) { 62 if(i %% 10==0) { 63 j <- j+1; 64 k <- 10 65 } 66 67 k <- k-1 68 points(j, k, pch=15, col=i, cex=3) 69 text(j+.45, k, i) 70 } 71 72 invisible() 73} 74