A liberal would never elect a conservative and vice versa, but there's an expectation to maintain the court's approximate balance (which is why Scalia's death is such a big deal). So if a very right-leaning justice stepped down under a liberal president, he'd elect a center / center-left justice. If the most left-wing justice in the world stepped down, then a left-wing president could elect the most left-leaning person.
As tptacek said, political labels aren't necessarily objective, so this graph would differ depending on the methodology. It's also a little harder to measure justices' leanings because there are so few data points.
Are there any examples where a liberal president nominated a conservative or vice-versa?
(I'm not talking about situations where someone was appointed as a conservative and moved gradually left, which actually happens to all justices.)