You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete vertical lines (or vertical rules) in plt.table? How to remove cell boundaries and shows table as scientific tables? #4044
Is there any way to remove the vertical lines in a matplotlib table?
Or even using text.usetex=True obtain a plot (using Arial for all texts and numbers) and append a table without vertical lines?
I tried to include some LaTeX stuff in another plot, which preserves Arial font, but does not render the table with horizontal lines Table correct. When I get the table as I want, the fonts can not be setted to Arial.
Here the codes show the plots in two steps. First generating the first plot and after running in a new session the second plot.
My main problem is to maintain the Arial font (mandatory rules in the guide for authors) and tables should be without vertical rules, as stated on first plot.
I have here three approachs and no one satisfy those recquirements (e.g. Arial font and table with no vertical lines)
It does not look like this is something that is currently supported via matplotlib.table, but I suspect it would not be too hard to do by sub-classing matplotlib.table.Cell (to override draw to not use a rectangle so you can drop the vertical bars) and matplotlib.table.Table (to override add_cell to use your new sub-class of Cell, or extent Table to make tuning the Cell class possible).
You might be better off in the short run annotate + axhline
I think that is along the lines of what I was thinking, but I would strongly advise against using the name 'type' and that shadows type which can have surprising behavior.
I would go with something like:
class Table(Artist):
def __init__(self, ax, loc=None, bbox=None, cell_cls=None, cell_kwargs=None **kwargs):
if cell_cls is None:
cell_cls = Cell
if cell_kwargs is None:
cell_kwargs = dict()
....
foo = cell_cls(..., **cell_kwargs)
....
Where I have thrown ... in to mean 'what ever code makes sense'.
I tried using this implementation but it looks like since you're using "path". You won't get a closed figure which you could've got by "Rectangle" and therefore you cannot fill color in that cell. Is there a workaround for losing the vertical lines and at the same time keeping the cell color?
Activity
tacaswell commentedon Jan 28, 2015
It does not look like this is something that is currently supported via
matplotlib.table, but I suspect it would not be too hard to do by sub-classingmatplotlib.table.Cell(to overridedrawto not use a rectangle so you can drop the vertical bars) andmatplotlib.table.Table(to overrideadd_cellto use your new sub-class ofCell, or extentTableto make tuning theCellclass possible).You might be better off in the short run
annotate+axhlinearnaldorusso commentedon Jan 30, 2015
Thank you @tacaswell for inlcuding this as wishlist label.
Always addressing good ideas (
annotate+axhline)!Cheers,
tacaswell commentedon Jan 30, 2015
@arnaldorusso Sorry to not be of more help.
When you get this figured out, can you consider providing it back as an example or an enhancement?
arnaldorusso commentedon Jan 30, 2015
A development task:
what could be the correct way, trying to do that @tacaswell ?
include a
typeof cells to be drawn? insideand include a parameter type as:
where self.types would be what??
which is the best way to include a parameter on
Tableclass to do not use rectagles ofCellclass?!Sorry about my bad english 😁
tacaswell commentedon Jan 30, 2015
I think that is along the lines of what I was thinking, but I would strongly advise against using the name 'type' and that shadows
typewhich can have surprising behavior.I would go with something like:
Where I have thrown
...in to mean 'what ever code makes sense'.arnaldorusso commentedon Jan 30, 2015
For sure
typeis not a good word... I'll try to do this as far as I can.Thanks for initial comments.
=]
pull request fixes for issue matplotlib#4044
pull request changes for matplotlib#4044, made the available cell typ…
pull request changes for matplotlib#4044
Added ScientificTable type and option.
Added ScientificTable type and option.
Added ScientificTable type and option.
arnaldorusso commentedon Apr 19, 2015
Awesome!!
Sorry to not dedicate my time on this issue!
Thanks at all!
markroxor commentedon Jun 27, 2016
I tried using this implementation but it looks like since you're using "path". You won't get a closed figure which you could've got by "Rectangle" and therefore you cannot fill color in that cell. Is there a workaround for losing the vertical lines and at the same time keeping the cell color?