Your modification (c -> cmap) of the original passage does remove the error, but it is not working as expected since cmap should not be used like that. For example, take a look at block [2] and print colors, you will find that last 2 color (for LHR, LHU) are exactly the same because the color map tab10 has only 10 colors. However, when you assign the tuple to the argument cmap, the argument doesn't recognize the float tuple. As a result, it is actually using a predefined color map.
Your modification (c -> cmap) of the original passage does remove the error, but it is not working as expected since cmap should not be used like that. For example, take a look at block [2] and print colors, you will find that last 2 color (for LHR, LHU) are exactly the same because the color map tab10 has only 10 colors. However, when you assign the tuple to the argument cmap, the argument doesn't recognize the float tuple. As a result, it is actually using a predefined color map.