As seen in a recent post in this blog, MapServer implements the optional WMS request GetLegendGraphic.
You can find that the generated icons do not fit your needs, and prefer that MapServer returns custom legend icons provided by you. Let’s see how can it be accomplished.
First, is convenient that in your LEGEND object you supply the icons size; in our example, it will be 20×20 pixels.
LEGEND ... KEYSIZE 20 20 END # end of legend object