title: Order dictionary with x and y coordinates in python
body: <p>I have this problem. </p>
  
  <p>I need order this points 1-7
  1(4,2), 2(3, 5), 3(1,4), 4(1,1), 5(2,2), 6(1,3), 7(1,5)</p>
  
  <p>and get this result
  4 , 6 , 3 , 5 , 2 , 1 , 7.</p>
  
  <p><a href="https://i.stack.imgur.com/hqAR7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hqAR7.jpg" alt="enter image description here"></a></p>
  
  <p>I am using a python script for sort with x reference and is ok, but the sort in y is wrong. </p>
  
  <p>I have tried with sorted(dicts,key=itemgetter(1,2))</p>
  
  <p>Someone can help me please ?</p>