Legend for smoothed lines

I want to plot smooth line between data points (Excel like) and I can do it with with 2 lines:

  • Original data points as circles, for instance: plot(x, y, ‘bo’)
  • Spline of these points as line: plot(xnew, ynew, ‘b-’)
    The only problem with this is the legend - I get either ‘o’ or ‘—’ but not the required ‘o-----o’.

Thanks for any suggestions,

···

This e-mail message may contain confidential,and privileged information or data that constitute proprietary information of CMT Medical Ltd. Any review or distribution by others is strictly prohibited. If you are not the intended recipient you are hereby notified that any use of this information or data by any other person is absolutely prohibited. If you are not the intended recipient, please delete all copies. Thank You. http://www.cmt.co.il



This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.


The easiest solution would be to use a proxy(?) artist.
For example,

  l1, = plot(x, y, "bo") # original points
  l2, = plot(xnew, ynew, "b-") # interpolated line

  l3, = plot(x, y, "bo-") # just for the legend
  l3.remove() # remove the line from the axes so that it is not drawn.

  legend([ll3], ["bo-"])

IHTH,

-JJ

···

On Mon, Apr 6, 2009 at 3:01 AM, Sahar <sahar@...2540...> wrote:

I want to plot smooth line between data points (Excel like) and I can do it
with with 2 lines:

Original data points as circles, for instance: plot(x, y, 'bo')
Spline of these points as line: plot(xnew, ynew, 'b-')

The only problem with this is the legend - I get either 'o' or '---' but not
the required 'o-----o'.

Thanks for any suggestions,

*******************************************************************************************************
This e-mail message may contain confidential,and privileged information or
data that constitute proprietary information of CMT Medical Ltd. Any review
or distribution by others is strictly prohibited. If you are not the
intended recipient you are hereby notified that any use of this information
or data by any other person is absolutely prohibited. If you are not the
intended recipient, please delete all copies. Thank You.
http://www.cmt.co.il
********************************************************************************************************

************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
************************************************************************************

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options