add legend_loc argumentn which takes a location string for the legend