I am creating a QgsVectorLayer in a plugin and loading it into the map. I would like to set the labelling parameters while I'm doing that. I've followed several examples found here and here, but my labels aren't being displayed. When I go to the labelling tool none of the settings are as I've specified.

Do you receive any errors from the Python Console when you run the above code? Also, you're labelling layer but you're adding vl to the canvas. Are they meant to be different?
– JosephJul 5 '16 at 12:02

1

@Joseph good pick, but changing it to vl only had partial improvements marked above. There are no Python errors
– marcpJul 5 '16 at 16:46

For future readers, Joseph and @artwork21 found typos in my code. I've incorporated their changes above, which is now a working example.
– marcpJul 6 '16 at 21:23