Workaround matplotlib bug