bugfix for some matplotlib versions