sort graphs into line and horizon