// This macros draws a graph in a stack using the // Plot.* functions added in ImageJ 1.31k. It requires v1.34j. // The macro reads a space (?) or tab seperated text file. If only one column is found than these are plotted against the row number // When more than one column is found, than the first is used as x-values and the rest as y-values // An example text file is available at: // http://rsb.info.nih.gov/ij/macros/data/PlotStackData.txt //author andreas schleifenbaum aschleifenbaum at web dot de macro "Plot-Stack" { //These are all colors allowed by Plot.setColor(); change the order as you like; colors may be duplicated to allow for more curves, or somewhere down changeColor may be introduced ... colors = newArray("red", "blue", "green", "black", "cyan", "darkGray", "gray", "lightGray", "magenta", "orange", "pink", "yellow") maxcolors=lengthOf(colors); requires("1.34j"); offset=getNumber("Offset",0.01); //Offset: % added to max/min of y-limits run("Text File... "); //open txt-file containing 2 space or tab-seperated columns starttime = getTime(); d=split(getInfo(),'\n'); //read rows into an array d; getInfo gives the content of the txt-file run("Close"); //close the txt-window current=split(d[0],''); // current is a working array curvecount = lengthOf(current); // get number of columns if (curvecount==1) { // if only one column, introduce an artificial x column for (i=0;i