このページは前リリースの情報です。該当の英語のページはこのリリースで削除されています。
thingSpeakPlot
2 次元ライン プロットの作成
説明
thingSpeakPlot(
では、1 つ以上の名前と値のペアの引数で指定される追加のオプションを使用して、ラインのタイプと色、およびデータ点のシンボルを指定できます。X
,Y
,Name,Value
)
例
正弦波プロットの作成
正弦波のライン プロットを作成します。
x = 0:pi/100:2*pi; y = sin(x); thingSpeakPlot(x,y)
行列ライン プロットの作成
4 行 4 列の魔方陣行列からライン チャートを作成します。
Y = magic(4); thingSpeakPlot(Y)
特定のライン プロパティでプロットを作成
特定のライン プロパティを使用してプロットを作成します。
以下のプロパティを指定します。
ライン スタイル: 破線
ライン幅: 2
ラインの色: 緑
マーカー タイプ: 正方形
x = -pi:pi/10:pi; y = tan(sin(x)) - sin(tan(x)); thingSpeakPlot(x,y,'LineStyle','--','LineWidth',2,'Color','green','Marker','s')
対数スケールのプロットを作成
対数スケールでライン プロットを作成します。
x = 0:0.1:10; y = exp(x); thingSpeakPlot(x,y,'YScale','log')
グリッド付きプロットの作成
背景にグリッドがあるプロットを作成します。
x = linspace(0,10); y = sin(x); thingSpeakPlot(x,y,'Grid','on')
年ラベルをもつプロットの作成
1900 年から 1990 年までの 10 年間隔の日付値を x 軸にもつライン プロットを作成します。
t = (1900:10:1990)'; p = [75.995 91.972 105.711 123.203 131.669 ... 150.697 179.323 203.212 226.505 249.633]'; thingSpeakPlot(datetime(t,1,1),p,'Grid','on')
月と日付の番号ラベルをもつプロットの作成
x 軸に datetime 値を一連の日付としてもつライン プロットを作成します。10 カレンダー日分を表示します。
t = datetime(2015,6,28) + caldays(1:10); y = rand(1,10); thingSpeakPlot(t,y,'Grid','on')
タイトルと軸ラベルをもつプロットの作成
タイトルと軸ラベルをもつライン プロットを作成します。
thingSpeakPlot([1:10].^2,'XLabel','Time','YLabel','Population','Title','Population in the 1900s');
入力引数
X
— X 値
ベクトル | スカラー | 行列
X 値。スカラー、ベクトル、または行列として指定します。X は数値配列、logical 配列、または datetime 配列にすることができます。
Y
— Y 値
ベクトル | スカラー | 行列
Y 値。スカラー、ベクトル、または行列として指定します。Y は数値配列、datetime 配列、または logical 配列にすることができます。
名前と値の引数
例: thingSpeakPlot(x,y,'Color','red','LineStyle',':','Marker','o')
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
Color
— ラインの色
[0 0.4470 0.7410] (既定値) | 文字列 | RGB 3 成分
ラインの色。'Color' と、RGB 3 成分または色を示す文字列で構成されるコンマ区切りのペアとして指定します。既定の RGB 3 成分値 [0 0 1] は青に当たります。
RGB 3 成分は、各要素が色の赤、緑、青の成分の強度を指定する 3 要素の行ベクトルです。強度値は [0,1]
の範囲でなければなりません。たとえば [0.4 0.6 0.7]
のようになります。次の表に、等価な色文字列をもつ RGB 3 成分の値を示します。
完全名 | 省略名 | RGB 3 成分 |
---|---|---|
'yellow' | 'y' | [1 1 0] |
'magenta' | 'm' | [1 0 1] |
'cyan' | 'c' | [0 1 1] |
'red' | 'r' | [1 0 0] |
'green' | 'g' | [0 1 0] |
'blue' | 'b' | [0 0 1] |
'white' | 'w' | [1 1 1] |
'black' | 'k' | [0 0 0] |
例: thingSpeakPlot(x,y,'Color',[1 0 1])
例: thingSpeakPlot(x,y,'Color','yellow')
LineStyle
— ライン スタイル
'-'
(既定値) | '--'
| ':'
| '-.'
| 'none'
ライン スタイル。'LineStyle' と、次の表に挙げるライン スタイル文字列のいずれかで構成されるコンマ区切りのペアとして指定します。
文字列 | ライン スタイル | 結果として得られる線 |
---|---|---|
'-' | 実線 |
|
'--' | 破線 |
|
':' | 点線 |
|
'-.' | 一点鎖線 |
|
'none' | ラインなし | ラインなし |
LineWidth
— プロット ラインの幅
0.5
(既定値) | 数値
ラインの幅。'LineWidth' と、領域の外枠の幅 (ポイント単位の正のスカラーとして指定) で構成されるコンマ区切りのペアとして指定します。
例: thingSpeakPlot(x,y,'LineWidth',1.5);
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Marker
— マーカー記号
'none' (既定値) | 文字列
マーカー記号。'Marker' と、次の表に挙げるマーカー記号文字列で構成されるコンマ区切りのペアとして指定します。
値 | 説明 |
---|---|
'o' | 円 |
'+' | プラス記号 |
'*' | アスタリスク |
'.' | 点 |
'x' | 十字 |
'square' または 's' | 正方形 |
'diamond' または 'd' | 菱形 |
'^' | 上向き三角形 |
'v' | 下向き三角形 |
'>' | 右向き三角形 |
'<' | 左向き三角形 |
'pentagram' または 'p' | 星形五角形 |
'hexagram' または 'h' | 星形六角形 |
'none' | マーカーなし |
例: thingSpeakPlot(x, y,'Marker','p');
YScale
— Y 軸のスケール
'linear'
(既定値) | 'log'
Y 軸のスケール。'YScale' と 1 つの文字列で構成されるコンマ区切りのペアとして指定します。使用できる値は linear
または log
です。
例: thingSpeakPlot(x, y,'YScale','log');
Grid
— プロット グリッド
'off'
(既定値) | 'on'
プロット グリッド。'Grid' と 1 つの文字列で構成されるコンマ区切りのペアとして指定します。使用できる値は 'on'
または 'off'
です。
例: thingSpeakPlot(x,y,'Grid','on');
YLabel
— Y 軸ラベル。'YLabel' と、Y 軸ラベル テキストを示す文字で構成されるコンマ区切りのペアとして指定します。
文字ベクトル | 文字列
Y 軸ラベル。文字列として指定します。
例: thingSpeakPlot(1:10,'XLabel','X-Axis');
XLabel
— X 軸ラベル
文字ベクトル | 文字列
X 軸ラベル。'XLabel' と、X 軸ラベル テキストを示す文字で構成されるコンマ区切りのペアとして指定します。
例: thingSpeakPlot(1:10,'YLabel','Y-Axis');
Title
— プロットのタイトル
文字ベクトル | 文字列
プロットのタイトル。'Title' と、タイトル テキストを示す文字で構成されるコンマ区切りのペアとして指定します。
例: thingSpeakPlot(1:10,'Title','Plot Title');
XGrid
— X 軸グリッドの指定
'off'
(既定値) | 'on'
X 軸グリッドを指定します。'XGrid' と 1 つの文字列で構成されるコンマ区切りのペアとして指定します。X 軸グリッドを表示するには、値を 'on'
に設定します。
YGrid
— Y 軸グリッドの指定
'off'
(既定値) | 'on'
Y 軸グリッドを指定します。'YGrid' と 1 つの文字列で構成されるコンマ区切りのペアとして指定します。Y 軸グリッドを表示するには、値を 'on'
に設定します。
Legend
— グラフへの凡例の追加
文字列
グラフへの凡例の追加。'Legend' と文字列の cell 配列で構成されるコンマ区切りのペアとして指定します。
例: thingSpeakPlot(x,y,'Legend',{'Sine','Cosine','Tangent'})
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)