make plotting code more concise. kjw