The invention relates to an ophthalmic marking unit (1) for mapping an axis on the cornea for aligning an intraocular lens. The marking unit comprises an elongate element (2) having a distal end (3) for touching the cornea. The elongate element also has a proximal end (4) provided with a coupling module for rigidly coupling the elongate element to a portable electronic device (20). The portable electronic device is capable of determining an angular orientation by using an included accelerometer (7).