Custom legend fragment formatter

Useful if you want to plot e.g. symbols in the legend.