Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 39 lines (31 sloc) 0.973 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#!/usr/bin/env Rscript

# Usage: dentograph.R mountain-data.txt filename.png "Library Name"

args <- commandArgs(TRUE)
datafile <- args[1]
output <- args[2]
library_name <- args[3]

png(filename=output, height=1600, width=1600, units="px")

d <- read.table(datafile)
table <- table(d)
x <- 1:nrow(table)
y <- 1:ncol(table)
res <- persp(x, y, table,
        zlim = c(0,10000), # Change as necessary, or comment out
        theta = -5, phi = 20,
        scale = TRUE,
        border = NA,
        axes = F,
        box = F,
        col = "cyan",
        shade = 0.5,
        main = library_name, cex.main = 5)

xpoints = read.csv("x-axis-labels.csv")

for (i in 1:nrow(xpoints)) {
  points(trans3d(xpoints$Point[i], 5, 0, pmat = res), col = "#000000",
        pch = xpoints$Label[i], cex = 2)
}

# Uncomment to draw lines along A, B, C, etc.
#
# for (i in 1:nrow(xpoints)) {
# lines(trans3d(x=xpoints$Point[i], y, z=0, pmat = res), col = "#00ffff")
# }
Something went wrong with that request. Please try again.