@@ -12,13 +12,13 @@ def __init__(self, context_):
1212
1313 def plot (self , data1 , data2 , tmpl , gm , grid , transform ):
1414 """Overrides baseclass implementation."""
15- Y = self ._context .trimData1D (data1 )
15+ Y = self ._context () .trimData1D (data1 )
1616 if data2 is None :
1717 X = Y .getAxis (0 )
1818 else :
1919 X = Y
2020 data1 ._yname = data2 .id
21- Y = self ._context .trimData1D (data2 )
21+ Y = self ._context () .trimData1D (data2 )
2222
2323 if gm .flip :
2424 tmp = Y
@@ -28,7 +28,7 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
2828 if gm .smooth is not None :
2929 Y = smooth (Y , gm .smooth )
3030
31- l = self ._context .canvas .createline ()
31+ l = self ._context () .canvas .createline ()
3232 Xs = X [:].tolist ()
3333 Ys = Y [:].tolist ()
3434 xs = []
@@ -72,7 +72,7 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
7272 x2 += .0001
7373 l ._worldcoordinate = [x1 , x2 , y1 , y2 ]
7474 if gm .marker is not None :
75- m = self ._context .canvas .createmarker ()
75+ m = self ._context () .canvas .createmarker ()
7676 m .type = gm .marker
7777 m .color = gm .markercolor
7878 if gm .markersize > 0 :
@@ -87,13 +87,13 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
8787 if not (Y [:].min () > max (y1 , y2 ) or Y [:].max () < min (y1 , y2 ) or
8888 X [:].min () > max (x1 , x2 ) or X [:].max () < min (x1 , x2 )):
8989 if l .priority > 0 :
90- self ._context .canvas .plot (l , donotstoredisplay = True )
90+ self ._context () .canvas .plot (l , donotstoredisplay = True )
9191 if gm .marker is not None and m .priority > 0 :
92- self ._context .canvas .plot (m , donotstoredisplay = True )
92+ self ._context () .canvas .plot (m , donotstoredisplay = True )
9393
94- ren2 = self ._context .createRenderer ()
95- self ._context .renWin .AddRenderer (ren2 )
96- tmpl .plot (self ._context .canvas , data1 , gm , bg = self ._context .bg ,
94+ ren2 = self ._context () .createRenderer ()
95+ self ._context () .renWin .AddRenderer (ren2 )
96+ tmpl .plot (self ._context () .canvas , data1 , gm , bg = self ._context () .bg ,
9797 renderer = ren2 , X = X , Y = Y )
9898 if hasattr (data1 , "_yname" ):
9999 del (data1 ._yname )
@@ -102,23 +102,23 @@ def plot(self, data1, data2, tmpl, gm, grid, transform):
102102 del (vcs .elements ["marker" ][m .name ])
103103
104104 if tmpl .legend .priority > 0 :
105- legd = self ._context .canvas .createline ()
105+ legd = self ._context () .canvas .createline ()
106106 legd .x = [tmpl .legend .x1 , tmpl .legend .x2 ]
107107 legd .y = [tmpl .legend .y1 , tmpl .legend .y1 ] # [y1, y1] intentional.
108108 legd .color = l .color
109109 legd .width = l .width
110110 legd .type = l .type
111- t = self ._context .canvas .createtext (
111+ t = self ._context () .canvas .createtext (
112112 To_source = tmpl .legend .textorientation ,
113113 Tt_source = tmpl .legend .texttable )
114114 t .x = tmpl .legend .x2
115115 t .y = tmpl .legend .y2
116116 t .string = data1 .id
117- self ._context .canvas .plot (t , donotstoredisplay = True )
117+ self ._context () .canvas .plot (t , donotstoredisplay = True )
118118 sp = t .name .split (":::" )
119119 del (vcs .elements ["texttable" ][sp [0 ]])
120120 del (vcs .elements ["textorientation" ][sp [1 ]])
121121 del (vcs .elements ["textcombined" ][t .name ])
122- self ._context .canvas .plot (legd , donotstoredisplay = True )
122+ self ._context () .canvas .plot (legd , donotstoredisplay = True )
123123 del (vcs .elements ["line" ][legd .name ])
124124 return {}
0 commit comments