matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (2024)

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表如何标注、如何在图中标记想要的点

matlab绘制二维曲线,如何在图中标记想要的点。。。如何设置线型、颜色、标记点类型。。。如何设置坐标轴。。。matlab 图表标注操作。。。

在MATLAB中,可以使用plot函数绘制图形,并使用text函数在图中标记想要的点。

例1:如何在图中标记一个点:

% 创建一个示例图形x = linspace(0,10,100);y = sin(x);figureplot(x, y);hold on;% 在图中标记一个点x_point = 5;y_point = sin(x_point);% plot(x_point, y_point, 'ro');%红色 o 标记% plot(x_point, y_point, 'r.', 'MarkerSize',12);% 指定标记样式、颜色、大小% plot(x_point, y_point, 'Color','red', 'Marker','.', 'MarkerSize',12);plot(x_point, y_point, 'r*');%红色 * 标记text(x_point, y_point, 'Point');% 设置图形标题和坐标轴标签title('示例图');xlabel('X轴');ylabel('Y轴');% 关闭图形保持功能hold off;

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (1)

例2:绘制曲线-创建后修改线

将x定义为−2π和2π之间的100个线性间隔值。将y1和y2定义为x的正弦和余弦值。创建两组数据的折线图,并画出曲线。

x = linspace(-2*pi,2*pi);y1 = sin(x);y2 = cos(x);figurep = plot(x,y1,x,y2);

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (2)

将第一行的线宽更改为2。将星形标记添加到第二行。使用点表示法设置特性。

x = linspace(-2*pi,2*pi);y1 = sin(x);y2 = cos(x);figurep = plot(x,y1,x,y2);p(1).LineWidth = 2;p(2).Marker = '*';

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (3)

例3:指定绘制曲线的样式

绘制三条正弦曲线,每条线之间有一个小的相移。对第一条线使用默认的线样式。为第二条线指定虚线样式,为第三条线指定点线样式。

x = 0:pi/100:2*pi;y1 = sin(x);y2 = sin(x-0.25);y3 = sin(x-0.5);figureplot(x,y1,x,y2,'--',x,y3,':')

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (4)

例4:指定线条样式、颜色和标记

x = 0:pi/100:2*pi;y1 = sin(x);y2 = sin(x-0.25);y3 = sin(x-0.5);figureplot(x,y1,x,y2,'--',x,y3,':')

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (5)

例5:在特定数据点显示标记

x = linspace(0,10);y = sin(x);plot(x,y,'-o','MarkerIndices',1:5:length(y))

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (6)

例6:指定线宽、标记大小和标记颜色

x = -pi:pi/10:pi;y = tan(sin(x)) - sin(tan(x));figureplot(x,y,'--gs',... 'LineWidth',2,... 'MarkerSize',10,... 'MarkerEdgeColor','b',... 'MarkerFaceColor',[0.5,0.5,0.5])

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (7)

例7:添加标题和轴标签

x = linspace(0,10,150);y = cos(5*x);figureplot(x,y,'Color',[0,0.7,0.9])txt = '\leftarrow cos(5*x)';text(5,0,txt,'Color','red','FontSize',12,'FontWeight','bold','Rotation',5, 'HorizontalAlignment', 'right', 'VerticalAlignment', 'top');%, 'BackgroundColor','white', 'EdgeColor','w');%title('2-D Line Plot')xlabel('x')ylabel('cos(5x)')

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (8)

x = 0:0.1:2*pi; y1 = sin(x); y2 = exp(-x);plot(x, y1, '--*', x, y2, ':o');xlabel('t = 0 to 2\pi');% 添加X轴标签ylabel('values of sin(t) and e^{-x}')% 添加Y轴标签title('Function Plots of sin(t) and e^{-x}');% 添加图表标题legend('sin(t)','e^{-x}');% 添加图例

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (9)

例8:绘制工期和指定刻度格式

t = 0:seconds(30):minutes(3);y = rand(1,7);figureplot(t,y,'DurationTickFormat','mm:ss')

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (10)

例9:从表中打印坐标

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (11)

tbl = readtimetable("weather.csv");tbl = sortrows(tbl);head(tbl,3)p = plot(tbl,"RainInchesPerMinute");

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (12)

tbl = readtimetable("weather.csv");tbl = sortrows(tbl);head(tbl,3)p = plot(tbl,"RainInchesPerMinute");p.LineStyle = ":";p.Color = "red";p.Marker = ".";

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (13)

例10:在一个轴上绘制多个图表,并添加图例

tbl = readtimetable("weather.csv");head(tbl,3)

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (14)

添加图例。请注意,图例标签与变量名称匹配。

plot(tbl,["Temperature" "PressureHg"])legend

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (15)

x=0:0.5:4*pi;y=sin(x); h=cos(x); w=1./(1+exp(-x)); g=(1/(2*pi*2)^0.5).*exp((-1.*(x-2*pi).^2)./(2*2^2));plot(x,y,'bd-' ,x,h,'gp:',x,w,'ro-' ,x,g,'c^-'); % 绘制多条图线legend('sin(x)','cos(x)','Sigmoid','Gauss function'); % 添加图例

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (16)

例11:指定直线打印的轴

可以使用tiledlayout和nexttile函数显示绘图的平铺。调用tiledlayout函数来创建一个2乘1的平铺图表布局。调用nexttile函数来创建一个axs对象,并将该对象返回为ax1。通过将ax1传递给绘图函数来创建顶部绘图。通过将轴传递给title和ylabel函数,将title和y轴标签添加到绘图中。重复该过程以创建底部绘图。

% Create data and 2-by-1 tiled chart layoutx = linspace(0,3);y1 = sin(5*x);y2 = sin(15*x);tiledlayout(2,1)% Top plotax1 = nexttile;plot(ax1,x,y1)title(ax1,'Top Plot')ylabel(ax1,'sin(5x)')% Bottom plotax2 = nexttile;plot(ax2,x,y2)title(ax2,'Bottom Plot')ylabel(ax2,'sin(15x)')

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (17)

例12:给图表添加注释

x = linspace(0,3); y = x.^2.*sin(x); plot(x,y);line([2,2],[0,2^2*sin(2)]);str = '$$ \int_{0}^{2} x^2\sin(x) dx $$';text(0.25,2.5,str,'Interpreter','latex');% 向数据点添加文本说明annotation('arrow','X',[0.32,0.5],'Y',[0.6,0.4]);% 创建注释

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (18)

plot()函数

2-D lineplot

图线的绘制与装饰

plot(x,y,LineSpec)

参数说明:

  • x : 图线上点的x坐标
  • y : 图线上点的y坐标
  • LineSpec : 图线的线条设定,三个指定 线型 , 标记符号 和 颜色 的 设定符 组成一个字符串,设定符不区分先后.具体细节请参考 官方文档 .

语法:

plot(X,Y)plot(X,Y,LineSpec)plot(X1,Y1,...,Xn,Yn)plot(X1,Y1,LineSpec1,...,Xn,Yn,LineSpecn)plot(Y)plot(Y,LineSpec)plot(tbl,xvar,yvar)plot(tbl,yvar)plot(ax,___)plot(___,Name,Value)p = plot(___)

参数说明:

Vector and Matrix Data

plot(X,Y)creates a 2-D lineplotof the data inYversus the corresponding values inX.

  • Toplota set of coordinates connected by line segments, specifyXandYas vectors of the same length.

  • Toplotmultiple sets of coordinates on the same set of axes, specify at least one ofXorYas a matrix.

plot(X,Y,LineSpec)creates theplotusing the specified line style, marker, and color.

plot(X1,Y1,...,Xn,Yn)plots multiple pairs ofx- andy-coordinates on the same set of axes. Use this syntax as an alternative to specifying coordinates as matrices.

plot(X1,Y1,LineSpec1,...,Xn,Yn,LineSpecn)assigns specific line styles, markers, and colors to eachx-ypair. You can specifyLineSpecfor somex-ypairs and omit it for others. For example,plot(X1,Y1,"o",X2,Y2)specifies markers for the firstx-ypair but not for the second pair.

plot(Y)plotsYagainst an implicit set ofx-coordinates.

  • IfYis a vector, thex-coordinates range from 1 tolength(Y).

  • IfYis a matrix, theplotcontains one line for each column inY. Thex-coordinates range from 1 to the number of rows inY.

IfYcontains complex numbers, MATLAB plots the imaginary part ofYversus the real part ofY. If you specify bothXandY, the imaginary part is ignored.

plot(Y,LineSpec)plotsYusing implicitx-coordinates, and specifies the line style, marker, and color.

Table Data

  1. plot(tbl,xvar,yvar)plots the variablesxvarandyvarfrom the tabletbl. Toplotone data set, specify one variable forxvarand one variable foryvar. Toplotmultiple data sets, specify multiple variables forxvar,yvar, or both. If both arguments specify multiple variables, they must specify the same number of variables.(since R2022a)
  2. plot(tbl,yvar)plots the specified variable from the table against the row indices of the table. If the table is a timetable, the specified variable is plotted against the row times of the timetable.(since R2022a)

Additional Options

  1. plot(ax,___)displays theplotin the target axes. Specify the axes as the first argument in any of the previous syntaxes.
  2. plot(___,Name,Value)specifiesLineproperties using one or more name-value arguments. The properties apply to all the plotted lines. Specify the name-value arguments after all the arguments in any of the previous syntaxes. For a list of properties, seeLine Properties.
  3. p =plot(___)returns aLineobject or an array ofLineobjects. Usepto modify properties of theplotafter creating it. For a list of properties, seeLine Properties.

设置线型、标记点样式、颜色:

LineSpec—Line style, marker, and color
string scalar|character vector

Line style, marker, and color, specified as a string scalar or character vector containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then theplotshows only the marker and no line.

Example:"--or"is a red dashed line with circle markers.

Line StyleDescriptionResulting Line
"-"Solid line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (19)

"--"Dashed line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (20)

":"Dotted line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (21)

"-."Dash-dotted line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (22)

MarkerDescriptionResulting Marker
"o"Circle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (23)

"+"Plus sign

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (24)

"*"Asterisk

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (25)

"."Point

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (26)

"x"Cross

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (27)

"_"Horizontal line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (28)

"|"Vertical line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (29)

"square"Square

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (30)

"diamond"Diamond

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (31)

"^"Upward-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (32)

"v"Downward-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (33)

">"Right-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (34)

"<"Left-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (35)

"pentagram"Pentagram

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (36)

"hexagram"Hexagram

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (37)

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (38)

"green""g"[0 1 0]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (39)

"blue""b"[0 0 1]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (40)

"cyan""c"[0 1 1]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (41)

"magenta""m"[1 0 1]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (42)

"yellow""y"[1 1 0]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (43)

"black""k"[0 0 0]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (44)

"white""w"[1 1 1]

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (45)

tbl—Source table
table|timetable

Source table containing the data toplot, specified as a table or a timetable.

xvar—Table variables containingx-coordinates
string array|character vector|cell array|pattern|numeric scalar or vector|logical vector|vartype()

Table variables containing thex-coordinates, specified using one of the indexing schemes from the table.

Indexing SchemeExamples

Variable names:

  • A string, character vector, or cell array.

  • Apatternobject.

  • "A"or'A'— A variable namedA

  • ["A","B"]or{'A','B'}— Two variables namedAandB

  • "Var"+digitsPattern(1)— Variables named"Var"followed by a single digit

Variable index:

  • An index number that refers to the location of a variable in the table.

  • A vector of numbers.

  • A logical vector. Typically, this vector is the same length as the number of variables, but you can omit trailing0orfalsevalues.

  • 3— The third variable from the table

  • [2 3]— The second and third variables from the table

  • [false false true]— The third variable

Variable type:

  • Avartypesubscript that selects variables of a specified type.

  • vartype("categorical")— All the variables containing categorical values

The table variables you specify can contain numeric, categorical, datetime, or duration values. Ifxvarandyvarboth specify multiple variables, the number of variables must be the same.

Example:plot(tbl,["x1","x2"],"y")specifies the table variables namedx1andx2for thex-coordinates.

Example:plot(tbl,2,"y")specifies the second variable for thex-coordinates.

Example:plot(tbl,vartype("numeric"),"y")specifies all numeric variables for thex-coordinates.

yvar—Table variables containingy-coordinates
string array|character vector|cell array|pattern|numeric scalar or vector|logical vector|vartype()

Table variables containing they-coordinates, specified using one of the indexing schemes from the table.

Indexing SchemeExamples

Variable names:

  • A string, character vector, or cell array.

  • Apatternobject.

  • "A"or'A'— A variable namedA

  • ["A","B"]or{'A','B'}— Two variables namedAandB

  • "Var"+digitsPattern(1)— Variables named"Var"followed by a single digit

Variable index:

  • An index number that refers to the location of a variable in the table.

  • A vector of numbers.

  • A logical vector. Typically, this vector is the same length as the number of variables, but you can omit trailing0orfalsevalues.

  • 3— The third variable from the table

  • [2 3]— The second and third variables from the table

  • [false false true]— The third variable

Variable type:

  • Avartypesubscript that selects variables of a specified type.

  • vartype("categorical")— All the variables containing categorical values

The table variables you specify can contain numeric, categorical, datetime, or duration values. Ifxvarandyvarboth specify multiple variables, the number of variables must be the same.

Example:plot(tbl,"x",["y1","y2"])specifies the table variables namedy1andy2for they-coordinates.

Example:plot(tbl,"x",2)specifies the second variable for they-coordinates.

Example:plot(tbl,"x",vartype("numeric"))specifies all numeric variables for they-coordinates.

ax—Target axes
Axesobject|PolarAxesobject|GeographicAxesobject

Target axes, specified as anAxesobject, aPolarAxesobject, or aGeographicAxesobject. If you do not specify the axes, MATLAB plots into the current axes or it creates anAxesobject if one does not exist.

To create a polarplotor geographicplot, specifyaxas aPolarAxesorGeographicAxesobject. Alternatively, call thepolarplotorgeoplotfunction.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example:plot([0 1],[2 3],LineWidth=2)

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:plot([0 1],[2 3],"LineWidth",2)

Note:The properties listed here are only a subset. For a complete list, seeLine Properties.

Color—Line color
[0 0.4470 0.7410](default) |RGB triplet|hexadecimal color code|"r"|"g"|"b"| ...

Line color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
"red""r"[1 0 0]"#FF0000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (46)

"green""g"[0 1 0]"#00FF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (47)

"blue""b"[0 0 1]"#0000FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (48)

"cyan""c"[0 1 1]"#00FFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (49)

"magenta""m"[1 0 1]"#FF00FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (50)

"yellow""y"[1 1 0]"#FFFF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (51)

"black""k"[0 0 0]"#000000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (52)

"white""w"[1 1 1]"#FFFFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (53)

"none"Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]"#0072BD"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (54)

[0.8500 0.3250 0.0980]"#D95319"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (55)

[0.9290 0.6940 0.1250]"#EDB120"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (56)

[0.4940 0.1840 0.5560]"#7E2F8E"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (57)

[0.4660 0.6740 0.1880]"#77AC30"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (58)

[0.3010 0.7450 0.9330]"#4DBEEE"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (59)

[0.6350 0.0780 0.1840]"#A2142F"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (60)

Example:"blue"

Example:[0 0 1]

Example:"#0000FF"

Line style, specified as one of the options listed in this table.

Line StyleDescriptionResulting Line
"-"Solid line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (61)

"--"Dashed line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (62)

":"Dotted line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (63)

"-."Dash-dotted line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (64)

"none"No lineNo line

Marker symbol, specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.

MarkerDescriptionResulting Marker
"o"Circle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (65)

"+"Plus sign

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (66)

"*"Asterisk

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (67)

"."Point

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (68)

"x"Cross

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (69)

"_"Horizontal line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (70)

"|"Vertical line

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (71)

"square"Square

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (72)

"diamond"Diamond

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (73)

"^"Upward-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (74)

"v"Downward-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (75)

">"Right-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (76)

"<"Left-pointing triangle

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (77)

"pentagram"Pentagram

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (78)

"hexagram"Hexagram

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (79)

"none"No markersNot applicable

Indices of data points at which to display markers, specified as a vector of positive integers. If you do not specify the indices, then MATLAB displays a marker at every data point.

Note:To see the markers, you must also specify a marker symbol.

Example:plot(x,y,"-o","MarkerIndices",[1 5 10])displays a circle marker at the first, fifth, and tenth data points.

Example:plot(x,y,"-x","MarkerIndices",1:3:length(y))displays a cross marker every three data points.

Example:plot(x,y,"Marker","square","MarkerIndices",5)displays one square marker at the fifth data point.

Marker outline color, specified as"auto", an RGB triplet, a hexadecimal color code, a color name, or a short name. The default value of"auto"uses the same color as theColorproperty.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1], for example,[0.4 0.6 0.7].

  • A hexadecimal color code is a string scalar or character vector that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from0toF. The values are not case sensitive. Therefore, the color codes"#FF8800","#ff8800","#F80", and"#f80"are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
"red""r"[1 0 0]"#FF0000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (80)

"green""g"[0 1 0]"#00FF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (81)

"blue""b"[0 0 1]"#0000FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (82)

"cyan""c"[0 1 1]"#00FFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (83)

"magenta""m"[1 0 1]"#FF00FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (84)

"yellow""y"[1 1 0]"#FFFF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (85)

"black""k"[0 0 0]"#000000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (86)

"white""w"[1 1 1]"#FFFFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (87)

"none"Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]"#0072BD"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (88)

[0.8500 0.3250 0.0980]"#D95319"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (89)

[0.9290 0.6940 0.1250]"#EDB120"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (90)

[0.4940 0.1840 0.5560]"#7E2F8E"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (91)

[0.4660 0.6740 0.1880]"#77AC30"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (92)

[0.3010 0.7450 0.9330]"#4DBEEE"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (93)

[0.6350 0.0780 0.1840]"#A2142F"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (94)

Marker fill color, specified as"auto", an RGB triplet, a hexadecimal color code, a color name, or a short name. The"auto"option uses the same color as theColorproperty of the parent axes. If you specify"auto"and the axesplotbox is invisible, the marker fill color is the color of the figure.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1], for example,[0.4 0.6 0.7].

  • A hexadecimal color code is a string scalar or character vector that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from0toF. The values are not case sensitive. Therefore, the color codes"#FF8800","#ff8800","#F80", and"#f80"are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
"red""r"[1 0 0]"#FF0000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (95)

"green""g"[0 1 0]"#00FF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (96)

"blue""b"[0 0 1]"#0000FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (97)

"cyan""c"[0 1 1]"#00FFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (98)

"magenta""m"[1 0 1]"#FF00FF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (99)

"yellow""y"[1 1 0]"#FFFF00"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (100)

"black""k"[0 0 0]"#000000"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (101)

"white""w"[1 1 1]"#FFFFFF"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (102)

"none"Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]"#0072BD"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (103)

[0.8500 0.3250 0.0980]"#D95319"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (104)

[0.9290 0.6940 0.1250]"#EDB120"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (105)

[0.4940 0.1840 0.5560]"#7E2F8E"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (106)

[0.4660 0.6740 0.1880]"#77AC30"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (107)

[0.3010 0.7450 0.9330]"#4DBEEE"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (108)

[0.6350 0.0780 0.1840]"#A2142F"

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (109)

Marker size, specified as a positive value in points, where 1 point = 1/72 of an inch.

DatetimeTickFormat—Format fordatetimetick labels
character vector|string

Format fordatetimetick labels, specified as the comma-separated pair consisting of"DatetimeTickFormat"and a character vector or string containing a date format. Use the lettersA-Zanda-zto construct a custom format. These letters correspond to the Unicode®Locale Data Markup Language (LDML) standard for dates. You can include non-ASCII letter characters such as a hyphen, space, or colon to separate the fields.

If you do not specify a value for"DatetimeTickFormat", thenplotautomatically optimizes and updates the tick labels based on the axis limits.

Example:"DatetimeTickFormat","eeee, MMMM d, yyyy HH:mm:ss"displays a date and time such asSaturday, April 19, 2014 21:41:06.

The following table shows several common display formats and examples of the formatted output for the date, Saturday, April 19, 2014 at 9:41:06 PM in New York City.

Value ofDatetimeTickFormatExample
"yyyy-MM-dd"2014-04-19
"dd/MM/yyyy"19/04/2014
"dd.MM.yyyy"19.04.2014
"yyyy年 MM月 dd日"2014年 04月 19日
"MMMM d, yyyy"April 19, 2014
"eeee, MMMM d, yyyy HH:mm:ss"Saturday, April 19, 2014 21:41:06
"MMMM d, yyyy HH:mm:ss Z"April 19, 2014 21:41:06 -0400

For a complete list of valid letter identifiers, see theFormatproperty for datetime arrays.

DatetimeTickFormatis not a chart line property. You must set the tick format using the name-value pair argument when creating aplot. Alternatively, set the format using thextickformatandytickformatfunctions.

TheTickLabelFormatproperty of the datetime ruler stores the format.

DurationTickFormat—Format fordurationtick labels
character vector|string

Format fordurationtick labels, specified as the comma-separated pair consisting of"DurationTickFormat"and a character vector or string containing a duration format.

If you do not specify a value for"DurationTickFormat", thenplotautomatically optimizes and updates the tick labels based on the axis limits.

To display a duration as a single number that includes a fractional part, for example, 1.234 hours, specify one of the values in this table.

Value ofDurationTickFormatDescription
"y"Number of exact fixed-length years. A fixed-length year is equal to 365.2425 days.
"d"Number of exact fixed-length days. A fixed-length day is equal to 24 hours.
"h"Number of hours
"m"Number of minutes
"s"Number of seconds

Example:"DurationTickFormat","d"displays duration values in terms of fixed-length days.

To display a duration in the form of a digital timer, specify one of these values.

  • "dd:hh:mm:ss"

  • "hh:mm:ss"

  • "mm:ss"

  • "hh:mm"

In addition, you can display up to nine fractional second digits by appending up to nineScharacters.

Example:"DurationTickFormat","hh:mm:ss.SSS"displays the milliseconds of a duration value to three digits.

DurationTickFormatis not a chart line property. You must set the tick format using the name-value pair argument when creating aplot. Alternatively, set the format using thextickformatandytickformatfunctions.

TheTickLabelFormatproperty of the duration ruler stores the format.

其他参考:

MATLAB04:基础绘图-CSDN博客

【matlab进阶学习-7】matlab 图表标注操作_matlab怎么给每条线标注-CSDN博客

matlab绘制二维曲线,如何设置线型、颜色、标记点类型、如何设置坐标轴、matlab 图表标注、在图中标记想要的点_matlab图标注某一点-CSDN博客 (2024)
Top Articles
Recipe—Sweet Potato Burritos
Chicken, Corn & Potato Chowder Recipe - Cookin' Canuck
No Hard Feelings (2023) Tickets & Showtimes
Why Are Fuel Leaks A Problem Aceable
Ups Stores Near
The Daily News Leader from Staunton, Virginia
Martha's Vineyard Ferry Schedules 2024
Alpha Kenny Buddy - Songs, Events and Music Stats | Viberate.com
Gameplay Clarkston
Pj Ferry Schedule
Tabler Oklahoma
Lesson 2 Homework 4.1
Ella Eats
Signs Of a Troubled TIPM
Slushy Beer Strain
Everything You Need to Know About Holly by Stephen King
Wilmot Science Training Program for Deaf High School Students Expands Across the U.S.
Pac Man Deviantart
Unlv Mid Semester Classes
Fraction Button On Ti-84 Plus Ce
Full Standard Operating Guideline Manual | Springfield, MO
PowerXL Smokeless Grill- Elektrische Grill - Rookloos & geurloos grillplezier - met... | bol
Robeson County Mugshots 2022
A Person That Creates Movie Basis Figgerits
Www.patientnotebook/Atic
Hood County Buy Sell And Trade
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
Ceramic tiles vs vitrified tiles: Which one should you choose? - Building And Interiors
Getmnapp
Www Pointclickcare Cna Login
How To Improve Your Pilates C-Curve
Federal Express Drop Off Center Near Me
Street Fighter 6 Nexus
Hotel Denizen Mckinney
Www.craigslist.com Syracuse Ny
24 slang words teens and Gen Zers are using in 2020, and what they really mean
Powerball lottery winning numbers for Saturday, September 7. $112 million jackpot
One Credit Songs On Touchtunes 2022
Kgirls Seattle
Craigslist Mount Pocono
Directions To Advance Auto
Encompass.myisolved
The best bagels in NYC, according to a New Yorker
All Obituaries | Sneath Strilchuk Funeral Services | Funeral Home Roblin Dauphin Ste Rose McCreary MB
Former Employees
Sarahbustani Boobs
Arginina - co to jest, właściwości, zastosowanie oraz przeciwwskazania
Rocket Bot Royale Unblocked Games 66
Electric Toothbrush Feature Crossword
Access One Ummc
Itsleaa
Craigslist Centre Alabama
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 6110

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.