/documentations/python_libraries/matplotlib/

Decorations

Decorations

The following example shows how to set some decoration elements. For customizing the Axis and axis Ticks see the example "Artist Components". The second example shows how to set background colors.

# Title and Labels
# (Image above)
import matplotlib.pyplot as plt
plt.subplot(1,1,1)
plt.plot([1, 4, 9, 16], label='my line')
plt.title('Title')
plt.xlabel('x-axis label')
plt.ylabel('y-axis label')
plt.grid(True)
plt.legend()
plt.show()

# Background Colors
import matplotlib.pyplot as plt
fig = plt.figure('my figure')
ax = fig.add_subplot(1,1,1)
fig.set_facecolor('yellow')
ax.set_axis_bgcolor('#ff6600')
plt.show()

More information at: