Skip to content

Table: auto_set_column_width not working #5479

Closed
@YujiShen

Description

@YujiShen
fig, axs = plt.subplots(1, 2, figsize=(6, 3))
ax1, ax2 = axs
ax1.axis('off')
ax2.axis('off')

# Table1 use auto_set_column_width
tb1 = ax1.table(cellText=[['Long Text', 2],['Long Long text', 1]],
          rowLabels=["A","B"],
          colLabels=["Col1","Col2"],
          loc="center")
tb1.auto_set_font_size(False)
tb1.set_fontsize(12)
tb1.auto_set_column_width(["Col1","Col2"]) # NOT WORKING
tb1.auto_set_column_width([-1,0,1]) # NOT WORKING

# Table 2 use _autoColumns
tb2 = ax2.table(cellText=[['Long Text', 2],['Long Long text', 1]],
          rowLabels=["A","B"],
          colLabels=["Col1","Col2"],
          loc="center")
tb2.auto_set_font_size(False)
tb2.set_fontsize(12)
tb2._autoColumns = [-1,0,1]

matplotlib_issue_2

Matplotlib 1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions