Python Forum
How to print subscript in TEXT using Graphics
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to print subscript in TEXT using Graphics
#1
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?
Reply
#2
Pyglit graphics.py or:
is this what you're using? https://github.com/so4pmaker/tictactoe/b...raphics.py
I can't find anything else.
Reply
#3
(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.
Reply
#4
(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
Reply
#5
that one is for a tic-tac-toe game, are you aware of that?
Reply
#6
(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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] What is the subscript error? Oshadha 3 2,325 Jan-19-2021, 07:19 PM
Last Post: deanhystad
  [Tkinter] Need some basic help with GUI graphics Jerz 2 2,955 Nov-11-2017, 12:10 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020