classmatplotlib.table.Cell(xy, width, height, edgecolor='k', facecolor='w', fill=True, text='', loc=None, fontproperties=None, *, visible_edges='closed')[source]
 
Bases: matplotlib.patches.Rectangle A cell is a Rectangle with some associated Text. As a user, you'll most likely not creates cells yourself. Instead, you should use either the table factory function or Table.add_cell.  Parameters 
 
xy2-tuple


The position of the bottom left corner of the cell.  
widthfloat


The cell width.  
heightfloat


The cell height.  
edgecolorcolor


The color of the cell border.  
facecolorcolor


The cell facecolor.  
fillbool


Whether the cell background is filled.  
textstr


The cell text.  
loc{'left', 'center', 'right'}, default: 'right'


The alignment of the text within the cell.  
fontpropertiesdict


A dict defining the font properties of the text. Supported keys and values are the keyword arguments accepted by FontProperties.  
visible_edgesstr, default: 'closed'


The cell edges to be drawn with a line: a substring of 'BRTL' (bottom, right, top, left), or one of 'open' (no edges drawn), 'closed' (all edges drawn), 'horizontal' (bottom and top), 'vertical' (right and left).       PAD=0.1
 
Padding between text and rectangle. 
   auto_set_font_size(renderer)[source]
 
Shrink font size until the text fits into the cell width. 
   draw(renderer)[source]
 
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False).  Parameters 
 
rendererRendererBase subclass.

   Notes This method is overridden in the Artist subclasses. 
   get_fontsize()[source]
 
Return the cell fontsize. 
   get_path()[source]
 
Return a Path for the visible_edges. 
   get_required_width(renderer)[source]
 
Return the minimal required width for the cell. 
   get_text()[source]
 
Return the cell Text instance. 
   get_text_bounds(renderer)[source]
 
Return the text bounds as (x, y, width, height) in table coordinates. 
   set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, bounds=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text_props=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, x=<UNSET>, xy=<UNSET>, y=<UNSET>, zorder=<UNSET>)[source]
 
Set multiple properties at once. Supported properties are   
Property Description   
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array  
alpha scalar or None  
angle unknown  
animated bool  
antialiased or aa bool or None  
bounds (left, bottom, width, height)  
capstyle CapStyle or {'butt', 'projecting', 'round'}  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
color color  
edgecolor or ec color or None  
facecolor or fc color or None  
figure unknown  
fill bool  
fontsize unknown  
gid str  
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}  
height unknown  
in_layout bool  
joinstyle JoinStyle or {'miter', 'round', 'bevel'}  
label object  
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}  
linewidth or lw float or None  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
rasterized bool  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
text_props unknown  
transform unknown  
url str  
visible bool  
width unknown  
x unknown  
xy (float, float)  
y unknown  
zorder float   
   set_figure(fig)[source]
 
Set the Figure instance the artist belongs to.  Parameters 
 
figFigure

   
   set_fontsize(size)[source]
 
Set the text fontsize. 
   set_text_props(**kwargs)[source]
 
Update the text properties. Valid keyword arguments are:   
Property Description   
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array  
alpha scalar or None  
animated bool  
backgroundcolor color  
bbox dict with properties for patches.FancyBboxPatch  
clip_box unknown  
clip_on unknown  
clip_path unknown  
color or c color  
figure Figure  
fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}  
fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path  
fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}  
fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}  
fontstyle or style {'normal', 'italic', 'oblique'}  
fontvariant or variant {'normal', 'small-caps'}  
fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}  
gid str  
horizontalalignment or ha {'center', 'right', 'left'}  
in_layout bool  
label object  
linespacing float (multiple of font size)  
math_fontfamily str  
multialignment or ma {'left', 'right', 'center'}  
parse_math bool  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
position (float, float)  
rasterized bool  
rotation float or {'vertical', 'horizontal'}  
rotation_mode {None, 'default', 'anchor'}  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
text object  
transform Transform  
transform_rotates_text bool  
url str  
usetex bool or None  
verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'}  
visible bool  
wrap bool  
x float  
y float  
zorder float   
   set_transform(trans)[source]
 
Set the artist transform.  Parameters 
 
tTransform

   
   propertyvisible_edges
 
The cell edges to be drawn with a line. Reading this property returns a substring of 'BRTL' (bottom, right, top, left'). When setting this property, you can use a substring of 'BRTL' or one of {'open', 'closed', 'horizontal', 'vertical'}.