We enumerate involutions according to the joint distribution of left-to-right and right-to-left maxima. From this computation we deduce the distribution of the static “number of visible pairs”, namely, the number of non-adjacent columns in the bargraph representation of a given permutation that are mutually visible to each other. The corresponding generating functions are expressible in terms of formal continued fractions. We obtain the same distribution over the set of involutions avoiding either the pattern 3412 or 4321. The proofs reside on a well-known bijection between involutions and labeled Motzkin paths.