@@ -23,13 +23,13 @@ def __init__(self, context_):
2323
2424 def plot (self , data1 , data2 , tmpl , gm , grid , transform ):
2525 """Overrides baseclass implementation."""
26- Y = self ._context .trimData1D (data1 )
26+ Y = self ._context () .trimData1D (data1 )
2727 if data2 is None :
2828 X = Y .getAxis (0 )
2929 else :
3030 X = Y
3131 data1 ._yname = data2 .id
32- Y = self ._context .trimData1D (data2 )
32+ Y = self ._context () .trimData1D (data2 )
3333
3434 if gm .flip :
3535 tmp = Y
@@ -39,7 +39,7 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
3939 if gm .smooth is not None :
4040 Y = smooth (Y , gm .smooth )
4141
42- l = self ._context .canvas .createline ()
42+ l = self ._context () .canvas .createline ()
4343 Xs = X [:].tolist ()
4444 Ys = Y [:].tolist ()
4545 xs = []
@@ -83,7 +83,7 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
8383 x2 += .0001
8484 l ._worldcoordinate = [x1 , x2 , y1 , y2 ]
8585 if gm .marker is not None :
86- m = self ._context .canvas .createmarker ()
86+ m = self ._context () .canvas .createmarker ()
8787 m .type = gm .marker
8888 m .color = gm .markercolor
8989 if gm .markersize > 0 :
@@ -98,13 +98,13 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
9898 if not (Y [:].min () > max (y1 , y2 ) or Y [:].max () < min (y1 , y2 ) or
9999 X [:].min () > max (x1 , x2 ) or X [:].max () < min (x1 , x2 )):
100100 if l .priority > 0 :
101- self ._context .canvas .plot (l , donotstoredisplay = True )
101+ self ._context () .canvas .plot (l , donotstoredisplay = True )
102102 if gm .marker is not None and m .priority > 0 :
103- self ._context .canvas .plot (m , donotstoredisplay = True )
103+ self ._context () .canvas .plot (m , donotstoredisplay = True )
104104
105- ren2 = self ._context .createRenderer ()
106- self ._context .renWin .AddRenderer (ren2 )
107- tmpl .plot (self ._context .canvas , data1 , gm , bg = self ._context .bg ,
105+ ren2 = self ._context () .createRenderer ()
106+ self ._context () .renWin .AddRenderer (ren2 )
107+ tmpl .plot (self ._context () .canvas , data1 , gm , bg = self ._context () .bg ,
108108 renderer = ren2 , X = X , Y = Y )
109109 if hasattr (data1 , "_yname" ):
110110 del (data1 ._yname )
@@ -113,23 +113,23 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
113113 del (vcs .elements ["marker" ][m .name ])
114114
115115 if tmpl .legend .priority > 0 :
116- legd = self ._context .canvas .createline ()
116+ legd = self ._context () .canvas .createline ()
117117 legd .x = [tmpl .legend .x1 , tmpl .legend .x2 ]
118118 legd .y = [tmpl .legend .y1 , tmpl .legend .y1 ] # [y1, y1] intentional.
119119 legd .color = l .color
120120 legd .width = l .width
121121 legd .type = l .type
122- t = self ._context .canvas .createtext (
122+ t = self ._context () .canvas .createtext (
123123 To_source = tmpl .legend .textorientation ,
124124 Tt_source = tmpl .legend .texttable )
125125 t .x = tmpl .legend .x2
126126 t .y = tmpl .legend .y2
127127 t .string = data1 .id
128- self ._context .canvas .plot (t , donotstoredisplay = True )
128+ self ._context () .canvas .plot (t , donotstoredisplay = True )
129129 sp = t .name .split (":::" )
130130 del (vcs .elements ["texttable" ][sp [0 ]])
131131 del (vcs .elements ["textorientation" ][sp [1 ]])
132132 del (vcs .elements ["textcombined" ][t .name ])
133- self ._context .canvas .plot (legd , donotstoredisplay = True )
133+ self ._context () .canvas .plot (legd , donotstoredisplay = True )
134134 del (vcs .elements ["line" ][legd .name ])
135135 return {}
0 commit comments