fix problem with old matplotlib versions