Ask Your Question
0

Resizing the table font to fit into the page

asked 2024-03-17 11:54:44 +0200

Cyrille gravatar image

This table

h_r=["Environnement","Transports","Sécurité","Santé","Sports-et-loisirs","Culture","Enseignement","Commerces","Qualité de vie"]
h_q=["","$\\textbf{Antony}$","$\\textbf{Aix les Bains}$","$\\textbf{Sceaux}$","$\\textbf{Maison-Laffite}$","$\\textbf{Saint-Gratien}$"]
Q=[[8.11,4,7.88,7.83,8.49,8.37,8.03,8.36,7.97,8.46],
[8.73,6.81,7.64,7.93,8.87,7.66,7.43,7.5,8.66],
[8.68,7.1,7.6,7.48,7.91,8.02,8.89,7.85,8.46],
[8.65,7.46,8.45,6.73,8.46,7.55,7.48,7.68,8.51],
[8.13,7.68,7.46,7.38,8.23,7.93,7.7,7.97,8.52]]
QQ=[[round(x,4) for x in Q[i]] for i in range(len(Q))]
T=table(QQ,header_row=h_r,header_column=h_q,align='center')
T

is nice looking but it will be better with a smaller font to fit in the page. Is this request possible ?

edit retag flag offensive close merge delete

Comments

why there is 10 values in the first line and 9 in other lines ? except this it is ok for me in Jupyter notebook.it fit in the page.

ortollj gravatar imageortollj ( 2024-03-23 19:02:44 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2024-03-18 07:48:20 +0200

Emmanuel Charpentier gravatar image

As far as I understand, you're generating LaTeX output. What about \small{T} ?

This tutorial might be helpful. More generally, this book, is also a good online source. But you may benefit of grabbing Leslie Lamport's book (which is only 30 years old), and read it... A bit of Googling may point out to a zillion online copies...

edit flag offensive delete link more

Comments

Emmanuel I used Latex since 1984. I want an ipyn readable easily not a LateX output

Cyrille gravatar imageCyrille ( 2024-03-18 15:43:36 +0200 )edit

Therefore, you want to customize your table for a specific output. Which one ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-03-18 16:57:48 +0200 )edit

When I compute $T$ in the code, it display a table. This is this table.

Cyrille gravatar imageCyrille ( 2024-03-19 19:16:41 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-03-17 11:54:44 +0200

Seen: 151 times

Last updated: Mar 18