Simplified plotting code.