Learn R Programming

largeVis (version 0.2.1.1)

manifoldMapStretch: manifoldMapStretch

Description

A manifold map that fills the full extent of the plot.

Usage

manifoldMapStretch(x, f, size_x = 500, size_y = 500, image_size = 50, ...)

Arguments

x

A [N,D] matrix of coordinates.

f

A function that, called with the index number of a row of x, returns an R object representing an image. See the example.

size_x

The width of the requested plot, in pixels.

size_y

The height of the requested plot, in pixels.

image_size

The size to plot each image; each is plotted as a square.

...

Additional parameters passed to plot.

Details

Ported from http://cs.stanford.edu/people/karpathy/cnnembed/. Each position is filled with its nearest neighbor.

Examples

Run this code
# NOT RUN {
# Demonstration of f
load(system.file("extdata", "faces.Rda", package="largeVis"))

imagepaths <- paste("pathtoimages",
   faceLabels[,1], sub("png", "jpg", faceLabels[,2]), sep = "/")

manifoldMapStretch(as.matrix(faceCoords[,1:2]),
   f = function(x) jpeg::readJPEG(imagePaths[x]),
   size_x = 5000, size_y = 5000, image_size = 100)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab