Matlab Plot 和 Line区别

Many MATLAB graphics functions call the object creation functions to draw graphics objects. However, high-level routines also clear the axes or create a new figure, depending on the settings of the axes and figure NextPlot properties.

Matlab图像函数请求对象创建函数画图像对象,但是,高级函数往往同时清除坐标轴或创建一幅新图像,取决于坐标轴的设置和图像的NextPlot属性。

In contrast, core object creation functions simply create their respective graphics objects and place them in the current parent object. They do not respect the settings of the figure or axes NextPlot property.

相反地,核心对象创建函数只创建它们各自的图像对象,把他们放在现有的父对象中,他们不管图像的设置或坐标轴的属性。

For example, if you call the line function,举例,如果请求Line 函数

line('XData',x,'YData',y,'ZData',z,'Color','r')

MATLAB draws a red line in the current axes using the specified data values. If there is no axes, MATLAB creates one. If there is no figure window in which to create the axes, MATLAB creates it as well.

Matlab用给出的数据在现有的坐标系中画一条红色的线。如果还没有坐标轴,会创建一个。如果甚至还没有图像窗口,也会创建一个。

If you call the line function a second time, MATLAB draws the second line in the current axes without erasing the first line. This behavior is different from high-level functions like plot that delete graphics objects and reset all axes properties (except Position and Units). You can change the behavior of high-level functions by using the hold command or by changing the setting of the axes NextPlot property.

但是!如果你再次请求line函数,MATLAB 在现有的坐标中画一条线,并不会擦除我们刚才画的那条。这与高级函数不同,如plot一样的高级函数,如果我们第二次请求,PLOT 会删除刚才的图像,重置坐标属性(除了Position和Units)。 你可以通过HOLD命令或改变坐标的NEXTPLOT属性设置来改变高级函数的这一行为。

你可能感兴趣的:(Matlab Plot 和 Line区别)