make matplotlib conditional