// "Rectangular Scattergraph" // Takes a CSV (comma-separated values) list of (x,y) coordinates // and draws a scattergraph. requires("1.37v"); progress("Open file, which must be a csv list in (value x, value y) format", 1, 10); string = File.openAsString(""); start = getTime; progress("Split the CSV file into an array of lines", 2, 10); lines = split(string, "\n"); //initialise some variables n = lengthOf(lines); x = newArray(n); y = newArray(n); xmax = 0; ymax = 0; progress("Find the maximum x and y (to determine the outer boundary)", 3, 10); for (i=0; i xmax) xmax = abs(x[i]); if (abs(y[i]) > ymax) ymax = abs(y[i]); } radius = 506; margin = 6; image = 2*(radius+margin); //Draw the new image setBatchMode(true); newImage("Untitled", "8-bit Black", image, image, 1); if (File.exists(getDirectory("imagej")+"luts/Orange Hot.lut")) run("Orange Hot"); else run("Fire"); progress("Save point coordinates in arrays", 4, 10); xp = newArray(n); yp = newArray(n); zp = newArray(n); for (i=0; imax) max = mean; } run("Select None"); progress("Draw each point in a color proportional to neighborhood density", 8, 10); scale = 200/(max-min); for (i=0; i