updated documentation and added example for plotlegend