mostly functional plotting