@@ -145,19 +145,29 @@ def set_text_props(self, **kwargs):
145
145
'update the text properties with kwargs'
146
146
self ._text .update (kwargs )
147
147
148
+
148
149
class SciCell (Cell ):
149
-
150
+ """
151
+ A SciCell is a Cell, but it only draws the horizontal lines of the Cell
152
+
153
+ """
154
+
155
+ def __init__ (self , * args , ** kwargs ):
156
+
157
+ # Call base
158
+ Cell .__init__ (self , * args , ** kwargs )
159
+
150
160
@allow_rasterization
151
161
def draw (self , renderer ):
152
162
if not self .get_visible ():
153
163
return
154
-
164
+
155
165
bbox = Rectangle .get_bbox (self )
156
166
x , y , w , h = bbox .bounds
157
167
158
- topLineVertices = [[x , y ],[x + w , y ]]
159
- botLineVertices = [[x , y + h ],[x + w , y + h ]]
160
-
168
+ topLineVertices = [[x , y ], [x + w , y ]]
169
+ botLineVertices = [[x , y + h ], [x + w , y + h ]]
170
+
161
171
topLine = Polygon (topLineVertices )
162
172
botLine = Polygon (botLineVertices )
163
173
@@ -171,6 +181,7 @@ def draw(self, renderer):
171
181
self ._set_text_position (renderer )
172
182
self ._text .draw (renderer )
173
183
184
+
174
185
class Table (Artist ):
175
186
"""
176
187
Create a table of cells.
@@ -492,7 +503,7 @@ def set_cell_type(self, cellType):
492
503
493
504
else :
494
505
raise ValueError ('Unrecognized cell type %s; '
495
- 'try default or scicell' % cellType )
506
+ 'Has to be default or scicell' % cellType )
496
507
497
508
498
509
def table (ax ,
@@ -573,7 +584,7 @@ def table(ax,
573
584
# Now create the table
574
585
table = Table (ax , loc , bbox , ** kwargs )
575
586
height = table ._approx_text_height ()
576
-
587
+
577
588
if cellType is not None :
578
589
table .set_cell_type (cellType )
579
590
0 commit comments