For duplicate-markers: I am fully aware that there are some similar questions in matplotlib
, such as this one. My question is about
It seems to me that this would be simple with code like the below:
import Tkinter
#Set up a basic canvas
top = Tkinter.Tk()
canv = Tkinter.Canvas(top, bg="brown", height=250, width=300)
#Replace with what ever values you want
x = 50
y = 50
#Draw the first dot
line1 = canv.create_line(x, y, x - 2, y - 2, fill="green", width=3)
#This next line is pretty much all it takes to find the Y inverse
y = canv.winfo_reqheight() - y
#Draw the second dot
line2 = canv.create_line(x, y, x - 2, y - 2, fill="green", width = 3)
canv.pack()
top.mainloop()
This returns the following:
Basically all I did was get the canvas height (250), and subtract the previous Y value (50) from it, which returned the Y inverse (200). Not exactly a built in function, but the actual flipping part was very simple. Hope that was what you were looking for... Good luck!