Improved documentation for the plotting function