work with older matplotlib versions