Gadfly 按 x 轴的递增顺序绘制,而不是按存储数组的顺序绘制

Gadfly plots in the increasing order of x axis, and not in the order of the stored arrays

我正在使用 Julia 0.6 中的 Gadfly 从数组中绘制一些参数。

这是我使用 Geom.point 时的输出。我希望在使用 Geom.line 时,这些点会像这个图一样连接,因为数组中的点是按此顺序存储的。

但是当我使用 Geom.line 时,我得到这个:

似乎 Gadfly 以 x 轴值的递增顺序连接点,而不考虑数组中存储的顺序。我在 matlab 中没有得到这种行为。我想知道有什么补救措施。

这里是一个参数(绿线)的代码片段。为了方便起见,我减少了点数:

x_axis = [22.5, 22.5, 22.5, 22.5, 22.5, 22.5, 22.5, 22.5, 24.0, 30.0, 30.0, 30.0, 3.0]
y_axis = [-48, -44, -40, -36, -32, -28, -24, -20, -16,-12, -8, -4, 0]


fricPlot = plot(x = x_axis, y = y_axis, 
Theme(default_color=colorant"green"), Geom.point,
            Guide.xlabel("Scaled (a-b)/ Stress value"),
            Guide.ylabel("Depth (m)"),
            Guide.title("Rate and state friction/Stress"),
            Coord.Cartesian(ymin=-24))

如何获得与点图完全一样的线图?

请参阅 Gadfly 文档中的 Geom.path。示例:

t = 0:0.2:8pi
plot(x=t.*cos.(t), y=t.*sin.(t), Geom.path)