If figure is returning None, it makes me think you must be using a somewhat old version of Bokeh. Can you confirm what version of Bokeh you are running? You can run
Just as a reminder, in order to help up support people in the most efficient way, I'd like to encourage everyone to always provide basic information about versions, platform, browsers, etc.
However, when I copied and pasted the codes directly, I get the error on lines:
p = figure()
p.patches([x2 for a in areas], list(areas.values()), color=colors, alpha=0.8, line_color=None)
AttributeError: 'NoneType' object has no attribute 'patches'
The same happened with I tried modifying the codes for my own data.
There are limited documentation on this and I don't know if this example is outdated.
Any help would be greatly appreciated!