Added backend switch statement in order to use TkAgg.