Hi everybody, In my own application, I want to specialize matplotlib.lines.Line2D to be able to deal with units. Concerning this class, is there a direct means to plot instances?
For example, if I do: >>> a=matplotlib.lines.Line2D([5,6],[7,8],color='m') To plot it, I have not found another way than doing: >>> plot(a.get_xdata(), a.get_ydata()) But it is clumsy, because if I want to keep the line color: >>> plot(a.get_xdata(), a.get_ydata(), a.get_color()) And so on for marker style, etc. Is there a direct means to plot a Line2D instance? Some time ago, a colleague wrote a "Curve_2D" class from scratch, to store a 2D curve, independently from matplotlib. Instead of that, I would like to be able to specialize Line2D matplotlib class. Am I compelled to write a .plot() method to Line2D? In other words, when I do: >>> a=plot((1,2),(2,3),'r--') I obtain a Line2D instance: >>> a[0] <matplotlib.lines.Line2D instance at 0x954d08c> I would like to do the contrary: define a Line2D instance, and then plot this Line2D. The goal is to avoid re-inventing the wheel in my application, as did my colleague. Thanks a lot for your help Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z (55l4('])" "When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong." (first law of AC Clarke) ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users