// This macro draws a scale bar on the image. Drop it in the // plugins folder, or sub-folder, and use Help>Refresh Menus // to create a "Draw Scale Bar" command. if (selectionType!=0) exit("Rectangular selection required"); getSelectionBounds(xbase, ybase, width, height); run("Select None"); getRawStatistics(pixels, mean, min, max); inc = (max-min)/height; value = min; print(min, max); for (y=ybase; y