@@ -129,8 +129,10 @@ def _encode_attr2(sendval, val, ismethods):
129129 s += "{:.16G}," .format (p )
130130 s = s [:- 1 ]
131131 elif sendval == 'plot' or sendval == 'data' :
132- for p in val :
133- s += "{:.16G},{:.16G}," .format (p [0 ], p [1 ])
132+ if sendval == 'data' and len (val ) == 0 : s += "None, None,"
133+ else :
134+ for p in val :
135+ s += "{:.16G},{:.16G}," .format (p [0 ], p [1 ])
134136 s = s [:- 1 ]
135137 elif sendval in ['v0' , 'v1' , 'v2' , 'v3' ]: # val is the vertex object referenced by triangle or quad
136138 s += str (val .idx )
@@ -2025,6 +2027,7 @@ def setup(self, args):
20252027 self ._interval = - 1
20262028 self ._graph = None
20272029 self ._visible = True
2030+ self ._data = []
20282031 objName = args ['_objName' ]
20292032 del args ['_objName' ]
20302033 self ._constructing = True ## calls are from constructor
@@ -2160,6 +2163,8 @@ def preresolve2(self, args):
21602163 raise AttributeError ("Cannot currently change color in a plot statement." )
21612164 if 'pos' in args :
21622165 return self .resolveargs (args ['pos' ])
2166+ elif 'data' in args :
2167+ return self .resolveargs (args ['data' ])
21632168 else :
21642169 raise AttributeError ("Must be plot(x,y) or plot(pos=[x,y]) or plot([x,y]) or plot([x,y], ...) or plot([ [x,y], ... ])" )
21652170
@@ -2168,6 +2173,7 @@ def plot(self, *args1, **args2):
21682173 p = self .preresolve1 (args1 )
21692174 else :
21702175 p = self .preresolve2 (args2 )
2176+ self ._data = self ._data + p
21712177 self .addmethod ('plot' , p )
21722178
21732179 @property
0 commit comments