Python Forum

Full Version: How to print subscript in TEXT using Graphics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using Graphics.py to draw my graphics. I want to print text in any special part of my graphics using
message=Text(Point(0,0),""). My problem is that i can't use something like r'$k_{xy}$' to make xy as subscript for k. It doesn't work. How can i solve this problem?
Pyglit graphics.py or:
is this what you're using? https://github.com/so4pmaker/tictactoe/b...raphics.py
I can't find anything else.
(Feb-22-2018, 04:12 PM)Shahnaz Wrote: [ -> ]My problem is that i can't use something like r'$k_{xy}$' to make xy as subscript for k
No you can't, you have to split the string up and display/write the first part, display/write the subscript at a different location (and different font if you want), and then display/write anything after that at a third location.
(Feb-22-2018, 07:10 PM)Larz60+ Wrote: [ -> ]Pyglit graphics.py or:
is this what you're using? https://github.com/so4pmaker/tictactoe/b...raphics.py
I can't find anything else.
I am using the one in the Link
that one is for a tic-tac-toe game, are you aware of that?
(Feb-22-2018, 07:17 PM)woooee Wrote: [ -> ]
(Feb-22-2018, 04:12 PM)Shahnaz Wrote: [ -> ]My problem is that i can't use something like r'$k_{xy}$' to make xy as subscript for k
No you can't, you have to split the string up and display/write the first part, display/write the subscript at a different location (and different font if you want), and then display/write anything after that at a third location.
Thank you Smile