Scatter plot

您所在的位置:网站首页 双杀露可娜娜剧透在线观看 Scatter plot

Scatter plot

#Scatter plot| 来源: 网络整理| 查看: 265

Table variables containing the x-coordinates, specified as one or more table variable indices.

Specifying Table Indices

Use any of the following indexing schemes to specify the desired variable or variables.

Indexing SchemeExamples

Variable names:

A string, character vector, or cell array.

A pattern object.

"A" or 'A' — A variable called A

["A","B"] or {'A','B'} — Two variables called A and B

"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 trailing 0 or false values.

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:

A vartype subscript that selects variables of a specified type.

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

Plotting Your Data

The table variables you specify can contain numeric, categorical, datetime, or duration values.

To plot one data set, specify one variable for xvar, and one variable for yvar. For example, read Patients.xls into the table tbl. Plot the Diastolic variable versus the Weight variable.

tbl = readtable('Patients.xls'); scatter(tbl,'Weight','Diastolic')

To plot multiple data sets together, specify multiple variables for xvar, yvar, or both. If you specify multiple variables for both arguments, the number of variables must be the same.

For example, plot the Systolic and Diastolic variables against the Weight variable.

scatter(tbl,'Weight',{'Systolic','Diastolic'})

You can use different indexing schemes for xvar and yvar. For example, specify xvar as a variable name and yvar as an index number.

scatter(tbl,'Weight',9)


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3