我有这个数据:
data2 缺少第三点。所以我想,我会定义两个不同的 x 列并将 data2 分配给 x2。
问题:data1 的第三个点在编译图形中上升到 3。如果我有不同的和更多的值,点开始去任何地方,但不是它们所属的地方。
那是我使用的代码:
\addplot[only marks, mark = diamond, color = orange, mark size = 3pt]
table[x=x1, y=data1]{example.dat};
\addlegendentry{data1};
\addplot[only marks, mark = square, color = gray, mark size = 3pt]
table[x=x2, y=data2]{example.dat};
\addlegendentry{data2};
\addplot[only marks, mark = o, color = blue, mark size = 3pt]
table[x=x1, y=data3]{example.dat};
\addlegendentry{data3};
这是我得到的图表:
非常感谢!
顺便提一句。在真实数据中,一个数据集在数据中间缺少 ax/y 值。我希望与我的示例相比,这并不重要。