add "legend" option and an example of its usage.