First, it is better to give a complete and running example:
Also, you should indicate the plotting libraries and/or backend to help you.