Add unit test for _plot_categorical_legend