how to show legend of graph in python code example Example: position of legend matplotlib plt.legend(loc='upper right')