Update twodim_base.py

Converted 2D-histogram example to doctest format according to the discussion of PR #3531.