Macro photography is probably one of the most challenging areas of photography you will find – and one of the most difficult areas to master is depth of field. The pictures above are of groupings of the same bunch of crayons, but the depth of field is completely different. On the left, only the green crayon is in sharp focus. The clarity drops off quickly to either side and above it to extremely blurry areas within an inch of two. The image on the right has a larger depth of field, and the part of the image in focus is considerably larger.
DOF is controlled with the aperture setting on your camera, how close you are to the subject and the lens focal length. There are some other items that can affect it, but those are the chief ones. Both images were shot with the same lens, but varied apertures and distance to subject. The image on the left was shot at f/3.3 and the right image was shot at f/19.0. The distance to the subject only varied by a couple of inches, but you can see the area that the lens can focus decreases as you get closer to your subject.
Another factor affecting the images is the ISO setting. Because of the short distance to subject and the small f-stop used, the image on the left is much darker than the one of the right, partially because I used different ISO settings. I may go back and re-shoot the left image, using a higher ISO, since its a little dark at ISO 200 (on the right, it was shot with an ISO of 800).