Skip to main content

15.6) More Labels


If you want to add a title and some labels, you can add commands before you create your plot with show().

To add a title with:

plt.title('My first plot',size=36.0)

To add some label within the plot:

plt.text(2.5, 2.0, 'label', size=18.0)

The first two numbers here correspond to the position of the label within the plot.

Plot a title and extra label.

Add these to your program and re-run it. Change the size of the title and the position of the label.