15.3.3.4 凡例プロパティ
legendオブジェクトのプロパティ(凡例を参照):
カテゴリー:
Callback Execution | Layout | Legend Appearance | Object Identification | Object Position | Text Appearance
コールバックの実行
itemhitfcn: 定義[](0x0)
凡例項目がクリックされたときに実行されるコールバック関数。コールバックのセクションを参照してください。
コールバック関数には次のプロトタイプが必要ですfcn (hlegend, evnt)。 はhlegend凡例オブジェクトのハンドルで、 はevnt次のフィールドを持つ構造体です。
Peer
クリックされた項目が関連付けられているプロット オブジェクトのハンドル。
Region
アイテムのどの部分がクリックされたかによって、 "icon"または異なる場合があります。"label"
SelectionType
"normal"、、、またはのいずれ"extend"か。図 を参照してください。 "open""alt""selectiontype"
Source
凡例オブジェクトのハンドル。
EventName
名前は です"ItemHit"。
レイアウト
autoupdate: "off"| { "on"}
ピア軸にオブジェクトが追加された (またはピア軸から削除された) ときに凡例項目の数を自動的に更新するかどうかを制御します。例:
## Create a single plot with its legend.
figure ();
plot (1:10);
legend ("Slope 1");
## Add another plot and specify its displayname so that
## the legend is correctly updated.
hold on;
plot ((1:10) * 2, "displayname", "Slope 2");
## Stop automatic updates for further plots.
legend ("autoupdate", "off");
plot ((1:10) * 3);
numcolumns: スカラー整数、定義1
凡例項目のレイアウトで使用する列の数を制御します。例:
figure ();
plot (rand (30));
legend ("numcolumns", 3);
を設定すると、プロパティnumcolumnsも に強制的numcolumnsmodeに設定されます"manual"。
orientation: "horizontal" | {"vertical"}
凡例項目を垂直方向 (列方向) に配置するか、水平方向 (行方向) に配置するかを制御します。
box: "off"| { "on"}
凡例を囲むボックスがあるかどうかを制御します。
color: colorspec、定義[1 1 1]
凡例の背景色。colorspec を参照してください。
edgecolor: colorspec、定義[0.1500 0.1500 0.1500]
凡例のアウトラインの色を制御します。
オブジェクトの識別
title: グラフィックハンドル
タイトル テキスト オブジェクトのグラフィック ハンドル。
オブジェクトの位置
location: "best" | "bestoutside" | "east" | "eastoutside" | "none" | "north" | {"northeast"} | "northeastoutside" | "northoutside" | "northwest" | "northwestoutside" | "south" | "southeast" | "southeastoutside" | "southoutside" | "southwest" | "southwestoutside" | "west" | "westoutside"
凡例の位置を制御します。
position: 4要素ベクトル
凡例のタイトルを除く位置を指定します。ベクトルの 4 つの要素は、凡例の左下隅の座標と幅と高さです。このプロパティを変更すると、 も に切り替わり"location"ます"none"。
units: "centimeters"| "characters"| "inches"| { "normalized"} | "pixels"| "points"
プロパティを解釈するために使用される単位"position"。
テキストの外観
fontangle: "italic"| { "normal"}
フォントが斜体か通常体かを制御します。
fontname: 文字列、定義"*"
テキストのレンダリングに使用されるフォントの名前。このプロパティを設定すると、テキスト レンダリング エンジンはシステム内で一致するフォントを検索します。何も見つからない場合、テキストはデフォルトのサンセリフ フォント (デフォルト"*"値と同じ) を使用してレンダリングされます。
プログラミング ノート: FontConfig をネイティブに使用しないシステム (Linux 以外) では、Octave のインストール時にフォント キャッシュが構築されます。system ("fc-cache -fv")新しいフォントをインストールした後は、手動で実行する必要があります。
fontsize: スカラー、定義9
テキストのレンダリングに使用されるフォントのサイズ。fontunitsプロパティを参照してください。 を設定すると、プロパティfontsizeも に強制的にfontsizemode設定されます"manual"。
fontunits: "centimeters"| "inches"| "normalized"| "pixels"| { "points"}
プロパティを解釈するために使用される単位"fontsize"。
fontweight: "bold"| { "normal"}
テキストのレンダリングに使用される基本フォントのバリアントを制御します。
string: 文字列 | 文字列のセル配列
凡例項目のラベルのリスト。例:
figure (); plot (rand (20)); ## Let legend choose names automatically hl = legend (); ## Selectively change some names str = get (hl, "string"); str(1:5:end) = "Garbage"; set (hl, "string", str);
textcolor: colorspec, def. [0 0 0]
凡例項目のテキスト文字列の色を制御します。