I don't seem to be able to figure out why pymupdf tools for placing objects on pdf documents has the origin set at a seemingly random location. Notice that (0,0,100,100), which is x0 y1 x2 y2 (where y starts from top) starts from the middle of the page for the y axis. x axis appears fine. I cannot seem to find anything in the documentation about this.
import fitz
doc = fitz.open('PDF4.pdf')
page = doc.load_page(0)
box = page.new_shape()
box.draw_rect(fitz.Rect(0, 0, 100, 100)) # x0, y0-2505, x2, y2
box.finish(color=(0, 0, 0), fill=(0, 0, 1),fill_opacity = 0.25)
box.commit()
doc.save("x.pdf")