// This macro generates a histogram of particle circularity.

  bins = 20;
  run("Set Measurements...", "area mean circularity redirect=None");
  run("Analyze Particles...",
    "minimum=1 maximum=999999 show=Nothing display clear");
  if (nResults==0) exit;

  // use the Analyze>Distribution command in v1.35g or later
  run("Distribution...", "parameter=Circ. or="+bins+" and=0-1");
  exit;

  // otherwise, use the following code
  newImage("temp", "32-bit", nResults, 1, 1);
  for (i=0; i<nResults; i++) 
      setPixel(i, 0, getResult("Circ.", i));
  run("Histogram", "x_min=0 x_max=1 y_max=Auto bins="+bins);
  selectWindow("temp");
  run("Close");
  selectWindow("Histogram of temp");
  run("Rename...", "title='Circularity Histogram'");
