当前位置: 首页 > news >正文

MATLAB 的 plot 绘图

文章目录

  • Syntax
  • Description
      • 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(___)

plot: 2-D line plot

Syntax

  1. plot(X,Y)
  2. plot(X,Y,LineSpec)
  3. plot(X1,Y1,…,Xn,Yn)
  4. plot(X1,Y1,LineSpec1,…,Xn,Yn,LineSpecn)
  5. plot(Y)
  6. plot(Y,LineSpec)
  7. plot(tbl,xvar,yvar)
  8. plot(tbl,yvar)
  9. plot(ax,___)
  10. plot(___,Name,Value)
  11. p = plot(___)

Description

plot(X,Y)

plot(X,Y) creates a 2-D line plot of the data in Y versus the corresponding values in X.

  1. To plot a set of coordinates connected by line segments, specify X and Y as vectors of the same length. (要绘制由线段连接的一组坐标,指定X和Y为相同长度的向量。)
  2. To plot multiple sets of coordinates on the same set of axes, specify at least one of X or Y as a matrix. (若要在同一组轴上绘制多组坐标,请将X或Y中的至少一个指定为矩阵。)

plot(X,Y,LineSpec)

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

plot(X1,Y1,…,Xn,Yn)

plot(X1,Y1,…,Xn,Yn) plots multiple pairs of x- and y-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)

plot(X1,Y1,LineSpec1,…,Xn,Yn,LineSpecn) assigns specific line styles, markers, and colors to each x-y pair. You can specify LineSpec for some x-y pairs and omit it for others. For example, plot(X1,Y1,“o”,X2,Y2) specifies markers for the first x-y pair but not for the second pair.

plot(Y)

plot(Y) plots Y against an implicit set of x-coordinates. (plot(Y)根据一组隐式的x坐标绘制Y。)

  1. If Y is a vector, the x-coordinates range from 1 to length(Y).
  2. If Y is a matrix, the plot contains one line for each column in Y. The x-coordinates range from 1 to the number of rows in Y. (如果Y是一个矩阵, 那么Y的每一列都会绘制出一条线, x坐标从1递增至Y的行数。)

If Y contains complex numbers, MATLAB® plots the imaginary part of Y versus the real part of Y. If you specify both X and Y, the imaginary part is ignored. (如果Y包含复数,MATLAB®绘制Y的虚部与Y的实部。如果同时指定X和Y,则忽略虚部。)

plot(Y,LineSpec)

plot(Y,LineSpec) plots Y using implicit x-coordinates, and specifies the line style, marker, and color.

plot(tbl,xvar,yvar)

plot(tbl,xvar,yvar) plots the variables xvar and yvar from the table tbl. To plot one data set, specify one variable for xvar and one variable for yvar. To plot multiple data sets, specify multiple variables for xvar, yvar, or both. If both arguments specify multiple variables, they must specify the same number of variables. (since R2022a) (Plot (tbl,xvar,yvar) 绘制表tbl中的变量xvar和yvar。要绘制一个数据集,请分别为xvar和yvar指定一个变量。若要绘制多个数据集,请为xvar、yvar或两者指定多个变量。如果两个参数都指定了多个变量,它们必须指定相同数量的变量。(自从R2022a))

plot(tbl,yvar)

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) (Plot (tbl,yvar) 根据表的行索引绘制表中的指定变量。如果表是时间表,则根据时间表的行时间绘制指定变量。(自从R2022a))

plot(ax,___)

plot(ax,___) displays the plot in the target axes. Specify the axes as the first argument in any of the previous syntaxes. (Plot (ax,___) 在指定的坐标轴上绘图。将坐标轴指定为第一个参数。)

plot(___,Name,Value)

plot(___,Name,Value) specifies Line properties 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, see Line Properties. (plot(___,Name,Value) 使用一个或多个名称-值参数指定线条属性。这些属性适用于所有绘制的线条。在所有参数之后指定名称-值参数。有关属性列表,请参见线条属性。)

p = plot(___)

p = plot(___) returns a Line object or an array of Line objects. Use p to modify properties of the plot after creating it. For a list of properties, see Line Properties. (p = plot(___) 返回一个Line对象或一个Line对象数组。使用p在创建绘图后修改其属性。)

Vector and Matrix DataTable DataAdditional Options
plot(X,Y)plot(tbl,xvar,yvar)plot(ax,___)
plot(X,Y,LineSpec)plot(tbl,yvar)plot(___,Name,Value)
plot(X1,Y1,…,Xn,Yn)p = plot(___)
plot(X1,Y1,LineSpec1,…,Xn,Yn,LineSpecn)
plot(Y)
plot(Y,LineSpec)
http://www.lryc.cn/news/157378.html

相关文章:

  • SpringBoot项目--电脑商城【获取省市区列表】
  • 使用git把本地项目关联远程代码仓库,并推送到远程仓库
  • Spring+MyBatis使用collection标签的两种使用方法
  • k8s集群中集群方式安装nacos
  • 极客时间:数据结构与算法之美【学习笔记+思考实践】
  • 基于视觉重定位的室内AR导航项目思路(2):改进的建图和定位分离的项目思路
  • nodejs+vue+elementui精品课程网站设计
  • 40个Linux常用命令组合
  • NIFI关于Variables的使用
  • 2、VRP基础
  • docker容器运行成功但无法访问,原因分析及对应解决方案(最新,以Tomcat为例,亲测有效)
  • 第15章 秒杀商品隔离解决方案
  • 2023-08-31力扣每日一题-姜汁水题
  • 五大优化技巧,让你的视频直播app源码更加流畅
  • Weblogic10中常用Linux指令
  • OpenAI 函数调用教程
  • Spark有两种常见的提交方式:client 模式和 cluster 模式对机器 CPU 的影响
  • HarmonyOS/OpenHarmony(Stage模型)应用开发单一手势(三)
  • Git的安装以及基础使用方法
  • 用通俗易懂的方式讲解大模型分布式训练并行技术:数据并行
  • Shopify电子邮件营销方法?邮件营销的技巧?
  • SpringCloud 初识
  • idea所有历史版本下载
  • Android笔记(二十八):在雷电模拟器安卓7.0+上使用Charles抓包详细教程
  • Python之数值和内建函数
  • 【CSS左右上角斜标签】CSS实现左右上角飘带功能,左右上角斜标签(附源码)
  • Java 日志技术
  • OpenCV(二十六):边缘检测(二)
  • 大数据平台之元数据
  • react脚手架初始化项目及ts的应用(react+ts)