Python tkinter label orientation Python tkinter label orientation tkinter tkinter

Python tkinter label orientation


You can achieve vertical display, without the text rotation, by using the wraplength option which set to 1 will force the next char into a new line:

 Label( master_frame,  text="Vertical Label", wraplength=1 ).grid( row=0, column=0 )


No, there is no way to display rotated text in the tkinter Label widget.


This is an issue I have also run into, and unfortunately there still is no simple angle argument for the tkinter Label widget. Nevertheless, to work around this whilst allowing dynamic labels, you can use the create_text() function within the tkinter canvas, which does have an angle argument. An example snippet from my code:

canvas_1_manage = tkinter.Canvas(nodeManager.window, width = 12, height = 50)canvas_1_manage.grid(row = 0, column = 0)canvas_1_manage.create_text(6, 50, text = "Node", angle = 90, anchor = "w")

This is part of a window builder function which produces the following:nodeManager Window