Each widget has a canvas, that is, a place to draw on. The canvas is a group of instructions that are executed whenever needed to keep the widget representation up to date. You can add two types of instructions to the canvas, context instructions and vertex instructions. You can put instructions either from python or from kv. If you add them from kv, the advantage is that they are automatically updated when any property they depend on change, in python, you need to do this yourself.