Remove unnecessary import
Excract the plot option handling and others into a common function
Use a more 'functional' approach to handle the iterators
Add some more plot styles: lines_points, x_error_lines, y_error_lines
Use an empty caption by default, so as not to leak implementation details when caption is omitted