The plot Function in matlab

from http://pundit.pratt.duke.edu/wiki/MATLAB:Plotting

The plot Function

The plot function is used to plot sets of data on a 2-D grid. What follows comes from MATLAB‘s help function in MATLAB R2009a[1] (some paragraphs have been snipped out). The line styles, symbols, and colors are formatted as a clearer table.

 PLOT   Linear plot.
    PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix,
    then the vector is plotted versus the rows or columns of the matrix,
    whichever line up.  If X is a scalar and Y is a vector, disconnected
    line objects are created and plotted as discrete points vertically at
    X.
 
    PLOT(Y) plots the columns of Y versus their index.
    If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)).
    In all other uses of PLOT, the imaginary part is ignored.
 
    Various line types, plot symbols and colors may be obtained with
    PLOT(X,Y,S) where S is a character string made from one element
    from any or all the following 3 columns:
Color code Meaning
b blue
g green
r red
c cyan
m magenta
y yellow
k black
w white
Symbol code Meaning
. point
o circle
x x-mark
+ plus
* star
s square
d diamond
v triangle (down)
^ triangle (up)
< triangle (left)
> triangle (right)
p pentagram
h hexagram
Line code Meaning
- solid
 : dotted
-. dash-dot
-- dashed
(continued)
    For example, PLOT(X,Y,‘c+:‘) plots a cyan dotted line with a plus
    at each data point; PLOT(X,Y,‘bd‘) plots blue diamond at each data
    point but does not draw any line.
 
    PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by
    the (X,Y,S) triples, where the X‘s and Y‘s are vectors or matrices
    and the S‘s are strings.
 
    For example, PLOT(X,Y,‘y-‘,X,Y,‘go‘) plots the data twice, with a
    solid yellow line interpolating green circles at the data points.
 
    The PLOT command, if no color is specified, makes automatic use of
    the colors specified by the axes ColorOrder property.  The default
    ColorOrder is listed in the table above for color systems where the
    default is blue for one line, and for multiple lines, to cycle
    through the first six colors in the table.  For monochrome systems,
    PLOT cycles over the axes LineStyleOrder property.
 
    If you do not specify a marker type, PLOT uses no marker.
    If you do not specify a line style, PLOT uses a solid line.
% snip
    The X,Y pairs, or X,Y,S triples, can be followed by
    parameter/value pairs to specify additional properties
    of the lines. For example, PLOT(X,Y,‘LineWidth‘,2,‘Color‘,[.6 0 0])
    will create a plot with a dark red line width of 2 points.
时间: 2024-10-14 23:13:42

The plot Function in matlab的相关文章

Multiple plot function

From: http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/ library(ggplot2) multiplot(p1, p2, p3, p4, cols=2) # Multiple plot function## ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)# - cols: Num

在Matlab中的plot

在Matlab中画图时,经常会使用plot函数命令.一些隐含的画图命令也默认调用plot函数命令,如spy命令,可以画出矩阵的稀疏度图形. 另外,有时为了方便,会将一些处理图形的操作和命令列在一块,命名为单独的文件.这时,要注意用于画图定义的文件不能是plot.m. 在Matlab中plot.m默认为画图的基本函数,重新定义该文件,会导致系统将之视为默认属性,影响其它图形. 原文地址:https://www.cnblogs.com/zdwt/p/8445971.html

Matlab的GUI参数传递方式总结

MATLAB GUI传递方式 1.全局变量: 2.作为函数的参数传递: 3.利用控件的userdata数据: 4.为handles结构体添加新字段: 5.setappdata函数为句柄添加数据: 6.跨空间计算evalin和赋值assignin: 7.将数据保存到文件,需要时读取: 8.带参数调用GUI的M文件: 9.嵌套函数(不适用于GUIDE中,只适用纯命令是的GUI). 一. 全局变量 运用global定义全局变量传递参数,适用于gui内控件间以及不同gui间.这种方式恐怕是最简单的方式,

Latex 中插入 Matlab 代码

这篇文章将介绍如何在 Latex 排版过程中添加 Matlab 代码 功能效果 主要有如下排版功能: 语法高亮 自动添加边框 自动添加行号 先上图,大家感受一下效果 listings 包 首先确保你能使用使用 listings 包 简单快捷的使用方法如下 \usepackage{listings} \lstset{language=Matlab} \begin{lstlisting} % Plot function f(x) = 2*x^3 - x - 2 ezplot('2*x^3-x-2',

java调用matlab函数

如何将实验结果在matlab中可视化呢,下面使用java语言编程,调用matlab中的函数: 本人安装的是Matlab7.11.0 (R2010a)和 Eclipse 4.2 : 1)首先设置环境变量,运行tomcat,Eclipse等都需要依靠环境变量JAVA_HOME,Path,classpath,具体的设置可以参考这里 为了使在matlab中将.m函数编译为jar包,还需要在classpath中添加: %matlabInstallRoot%\R2010a\toolbox\javabuild

MatLab~Help Document

维基百科 创建数组 To create an array with four elements in a single row, separate the elements with either acomma (,) or a space. a = [1 2 3 4]%行向量 All MATLAB variables are multidimensional arrays, no matter what type of data. A matrix is a two-dimensional a

Matlab绘制图像及图像的处理

一 绘制函数图像 matlab平面绘制函数图像有多个函数,plot,ezplot等. 1.1 plot函数 查看matlab的帮助文件可知plot函数的调用格式有 PLOT Linear plot. PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix,    then the vector is plotted versus the rows or columns of the matrix,    whichever

Matlab中所有自定义的函数

Functions By Category | Alphabetical List Language Fundamentals Entering Commands ans Most recent answer clc Clear Command Window diary Save Command Window text to file format Set display format for output home Send cursor home iskeyword Determine wh

[MATLAB] 利用遗传算法函数求目标函数的最优解

最近接触到了遗传算法以及利用遗传算法求最优解,所以就把这些相关的内容整理记录一下. 一.遗传算法简介(摘自维基百科) 遗传算法(英语:genetic algorithm (GA))是计算数学中用于解决最佳化的搜索算法,是进化算法的一种.进化算法最初是借鉴了进化生物学中的一些现象而发展起来的,这些现象包括遗传.突变.自然选择以及杂交等. 算法 选择初始生命种群 循环 评价种群中的个体适应度 以比例原则(分数高的挑中概率也较高)选择产生下一个种群. 改变该种群(交叉和变异) 直到停止循环的条件满足