同样,任何这些变化都要求您了解点之间的连接性。有一些方案有时可以从孤立点列表中恢复连接。其中一种方法称为 CRUST,通常用于 3- d 表面重建。我通过简单搜索“外壳算法”找到了很多参考资料。
If you have an existing plot as a scatter plot, you cannot simply just join the dots without knowing which points are connected to which others.
If you know the order/connectivity of the points, then you could simply have used the plot function to do that in the first place. The call
plot(x,y,'-')
will connect the dots with straight line segments. If you wish to use a marker symbol at each point along the line, then you can add one of the markers that plot allows, as this:
plot(x,y,'o-')
You can get a list of the allowed markers from
help plot
If you have used scatter on a set of points, and now wish to overlay a line connecting the points, then use the hold function to force matlab to plot on top of the scatter plot. For example,
scatter(x,y)
hold on
plot(x,y,'-')
hold off
Again, any of these variations require you to know the connectivity between the points. There are some schemes that can sometimes work to recover that connectivity from a list of isolated points. One of these methods is called CRUST, often used for 3-d surface reconstruction. I found many references by a simple search for "crust algorithm".
h = findobj(gca,'type','hggroup');
hold on
for k=1:numel(h)
x = get(h(k),'xdata');
y = get(h(k),'ydata');
plot(x,y,'-')
end
hold off
这些点将按其原始顺序连接。如果需要,可以在绘图之前对数据进行排序,例如按 x:
[x,ind] = sort(x);
y = y(ind);
If you have a scatterplot (made with the scatter function I suspect) and for some reason don't want to redraw it with plot, here is what you can do to connect the dots:
h = findobj(gca,'type','hggroup');
hold on
for k=1:numel(h)
x = get(h(k),'xdata');
y = get(h(k),'ydata');
plot(x,y,'-')
end
hold off
The dots will be connected by their original order. If you want you can sort the data before plot, for example by x:
指定选项 style = pointline 显示点和连接线; style = line 仅显示线条。
To answer the question of how to do this in Maple, you can simply use the PointPlot command from the Statistics package with the style option set to line or pointline. For example:
发布评论
评论(4)
我猜您从
x
和y
坐标生成了一个散点图,通过以下方式将它们连接起来
Or 在一个命令中
这是您想要的吗?
I'm guessing you generated a scatter plot from
x
andy
coordinates by,Join them with
Or in one command
Is this what you wanted?
如果您有一个现有的散点图,则您不能简单地连接这些点而不知道哪些点与其他点相连。
如果您知道点的顺序/连接性,那么您可以首先使用绘图函数来完成此操作。该调用
将用直线段连接这些点。如果您希望沿线的每个点使用标记符号,则可以添加绘图允许的标记之一,如下所示:
则可以从以下位置获取允许的标记列表
如果您在一组点上使用了散点图, ,现在希望覆盖一条连接点的线,然后使用hold函数强制matlab在散点图的顶部绘制。例如,
同样,任何这些变化都要求您了解点之间的连接性。有一些方案有时可以从孤立点列表中恢复连接。其中一种方法称为 CRUST,通常用于 3- d 表面重建。我通过简单搜索“外壳算法”找到了很多参考资料。
If you have an existing plot as a scatter plot, you cannot simply just join the dots without knowing which points are connected to which others.
If you know the order/connectivity of the points, then you could simply have used the plot function to do that in the first place. The call
will connect the dots with straight line segments. If you wish to use a marker symbol at each point along the line, then you can add one of the markers that plot allows, as this:
You can get a list of the allowed markers from
If you have used scatter on a set of points, and now wish to overlay a line connecting the points, then use the hold function to force matlab to plot on top of the scatter plot. For example,
Again, any of these variations require you to know the connectivity between the points. There are some schemes that can sometimes work to recover that connectivity from a list of isolated points. One of these methods is called CRUST, often used for 3-d surface reconstruction. I found many references by a simple search for "crust algorithm".
如果您有一个散点图(我怀疑是用散点函数制作的)并且由于某种原因不想用绘图重新绘制它,那么您可以执行以下操作来连接这些点:
这些点将按其原始顺序连接。如果需要,可以在绘图之前对数据进行排序,例如按 x:
If you have a scatterplot (made with the scatter function I suspect) and for some reason don't want to redraw it with plot, here is what you can do to connect the dots:
The dots will be connected by their original order. If you want you can sort the data before plot, for example by x:
要回答如何在 Maple 中执行此操作的问题,您只需使用 统计 的“nofollow noreferrer">PointPlot 命令将
style
选项设置为line
或pointline
的包。例如:指定选项
style
=pointline
显示点和连接线;style
=line
仅显示线条。To answer the question of how to do this in Maple, you can simply use the PointPlot command from the Statistics package with the
style
option set toline
orpointline
. For example:Specifying the option
style
=pointline
shows both the points and a connecting line;style
=line
shows just the line.