// These macros draw example graphs using the // macro language Plot.* functions. // There is a JavaScript version at // http://imagej.nih.gov/ij/macros/js/ExamplePlots.js macro "Simple Plot" { yValues = newArray(0, 0.7, 2.3, 2.8, 1, 0.5); Plot.create("Simple Plot", "X", "Y", yValues); setJustification("center"); Plot.addText("This is a line of centered text", 0.5, 0.5); setJustification("right"); Plot.addText("This is a line of right justified text", 0.5, 0.7); setJustification("left"); Plot.addText("This is a line of left justified text", 0.5, 0.9); } macro "Fancier Plot" { yValues = newArray(0, 0.7, 2.3, 2.8, 1, 0.5); Plot.create("Fancier Plot", "X", "Y"); Plot.setLimits(0, 5, 0, 3); Plot.setLineWidth(2); Plot.setColor("lightGray"); Plot.add("line", yValues); Plot.setColor("red"); Plot.add("circles", yValues); Plot.show(); } macro "Error Bars" { xValues = newArray(0.1, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95); yValues = newArray(2,5.6,7.4,9,9.4,8.7,6.3,4.5,1); errorBars = newArray(0.8,0.6,0.5,0.4,0.3,0.5,0.6,0.7,0.8); Plot.create("Error Bars", "X", "Y", xValues, yValues); Plot.setLimits(0, 1, 0, 10); Plot.setLineWidth(2); Plot.add("error bars", errorBars); Plot.show(); } macro "Scatter Plot" { n = 5000; x = newArray(n); y = newArray(n); for (i=0; i