# NOT RUN {
# An imitation of Fredericksen et al.'s (1997) Fig 1.
# that demonstrate the relation between peak contrast
# and perceived size of the Gabor
op <- par(mfcol = c(3, 3), pty = "m", mai = c(0,0,0,0))
for(i in c(.85, .21, .06)){
for(j in c(1/6, 1/7, 1/8)){
gaborPatch(20, pc = i, sigma = j)
}
}
par(op)
# }
# NOT RUN {
# a typical plot of the stimuli and category structure
# often seen in artificial category-learning literatures.
m <- list(c(268, 157), c(332, 93))
covs <- matrix(c(4538, 4351, 4351, 4538), ncol = 2)
II <- grtrnorm(n = 40, np = 2, means = m, covs = covs,
clip.sd = 4, seed = 1234)
II$sf <- .25+(II$x1/50)
II$theta <- II$x2*(18/50)
plot(II[,2:3], xlim = c(-100,600), ylim = c(-200,500),
pch = 21, bg = c("white","gray")[II$category])
abline(a = -175, b = 1)
library(Hmisc)
idx <- c(20, 31, 35, 49, 62)
xpos <- c(0, 100, 300, 350, 550)
ypos <- c(50, 300, 420, -120, 50)
for(i in 1:5)
{
j = idx[i]
segments(x0=II[j,"x1"], y0=II[j,"x2"], x1=xpos[i], y1=ypos[i])
subplot(gaborPatch(sf=II[j,"sf"], theta=II[j,"theta"]), x=xpos[i], y=ypos[i])
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab