1.How do you show a legend for a line chart with multiple lines in python?
2.How you set a title for a chart in python?
import matplotlib.pyplot as plt
# data sets are x,y and a,b
fig, ax = plt.subplots()
ax.plot(x, y)
ax.plot(a, b)
# to set legend
ax.legend()
# to set title
ax.title()
Comments
Leave a comment