add legend_bug figures and test code