As is usual in Photoshop, there are several other ways this can be done. For example, you could (a) use the duotone feature in PS (Google it), or (b) you could put a B&W adjustment layer, and then a purple color layer above the image, set the layer blend mode to "color", and adjust the blend_If sliders to predominantly recolor the darker areas of the image, etc. etc.
In all of these methods (including the gradient map method), don't assume one single technique will get you exactly what you want. For example, one often needs to first adjust the brightness and contrast of a image before you re-color it.
Tom M