Completed adding g_legend with example