1. A method for visualization, comprising: receiving an input indicative of respective apparent coordinates of a plurality of points disposed along a length of a probe inside a body of a subject; applying a model of known mechanical properties of the probe to the apparent coordinates so as to compute a cost function with respect to shapes that can be assumed by the probe in the body; choosing a shape responsively to the cost function; generating corrected coordinates of the points along the length of the probe based on the shape; and displaying a representation of the probe using the corrected coordinates.