-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[Bug]: fontsize in tables not working #29202
Copy link
Copy link
Closed
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!topic: table
Milestone
Description
Bug summary
Specifying fontsize kwarg in matplotlib.pyplot.table doesn't have any effect.
Code for reproduction
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
y = x + 1
tableData = [['a', 1], ['b', 1]]
fig, ax = plt.subplots()
ax.plot(x, y)
t = ax.table(
cellText=tableData,
loc='top',
cellLoc='center',
fontsize=30
)
plt.show()Actual outcome
Expected outcome
A table with bigger font size.
Additional information
This works:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
y = x + 1
tableData = [['a', 1], ['b', 1]]
fig, ax = plt.subplots()
ax.plot(x, y)
t = ax.table(
cellText=tableData,
loc='top',
cellLoc='center'
)
t.set_fontsize(30) # <----------------
plt.show()
Operating system
Windows 11
Matplotlib Version
3.8.2
Matplotlib Backend
QtAgg
Python version
3.12.0
Jupyter version
No response
Installation
pip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!topic: table

