Hi all,

I am trying to build a two-way scatterplot having on the y axis values of a variable called own sorted in descending order and on the x axis values of a corresponding variable called mean price. Now the point is that on the x axis I would like data not to have a specific order. They have indeed to follow the descending order of the corresponding y-axis data.

For instance:

own mean_price
5 8
-2 23
-4 3
0 12

I would like on the y-axis data to be inputted in descending order and on the x-axis to follow, hence:

own (y) mean_price (x)
5 8
0 12
-2 23
-4 3

with x-axis being: 8 12 23 3 (i.e. regardless of the normal ordering of numbers) and the scatter points being displayed in the order (8,5); (12,0), (23,-2); (3,-4) rather than the "normal" ordering that would follow the x axis values: (3,-4); (8,5), (12,0); (23,-2). I have tried sorting the data before but it does not quite work.

Actually I am trying the following but with scarce results:

Code:
twoway (scatter own mean_price, msize(small) sort (id_mol own)) if ctry_name == "BELG", title("BELG") legend(order(1 "Own el. n.s." 2 "Own el. sign.")) xtitle("Mean price")  ylabel(, angle(0)) ytitle("own elasticity")
Can anyone please help?