 |
2Dプロット
graph(graph_input) この関数は入力条件とカレントのデータセットに基づいて2Dプロットを作成するために使用されます。入力引数はgraph_inputテーブルです。出力は画面表示される2Dプロットのハンドルです。現在graphコマンドはMAC OSではサポートされていません。
graph_input このテーブルはgraph関数の入力引数として使用されます。 このテーブルのフィールドは描画されるグラフのパラメータを指定します。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| title |
string |
例: “Graph Title” |
|
| grid |
table |
grid_table = {}。 この空テーブルが存在する場合、グラフの背景にグリッドが表示されます。 |
|
| background |
string |
color_spec:既知の色の名前または色の16進値の文字列。 例:”#rrggbb”、ここで、”rr”、”gg”および”bb”にはそれぞれ赤、緑および青の16進表現を指定します。 |
|
| plotbackground |
string |
上記のcolor_specを参照してください。 |
|
| line |
table |
line_table(1つ以上のエントリを持つテーブル) |
|
| bar |
table |
bar_table(1つ以上のエントリを持つテーブル) |
|
| x_axis |
table |
x軸についての1つのaxis_tableエントリを持つテーブル |
|
| y_axis |
table |
左側y軸についての1つのaxis_tableエントリを持つテーブル |
|
| y2_axis |
table |
右側y軸についての1つのaxis_tableエントリを持つテーブル |
|
line_table このテーブルは2Dプロット上に描画される線のプロパティを指定するために使用します。これはgraph_inputテーブルのテーブル内フィールドです。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| title |
string |
線のタイトル(オプション) |
“lineN” |
| xdata |
table |
数値インデックスと対応する数値を持つテーブル(必須) |
|
| ydata |
table |
数値インデックスと対応する数値を持つテーブル(必須) |
|
| option |
table |
line_option_table |
|
line_option_table このテーブルは2Dプロット上に描画される線のプロパティを指定するために使用します。これはline_table内のフィールドです。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| color |
string |
このフィールドは線の色をcolor_specにより指定します。color_spec:既知の色の名前または色の16進値の文字列。 例:”#rrggbb”、ここで、”rr”、”gg”および”bb”にはそれぞれ赤、緑および青の16進表現を指定します。 |
|
| pixels |
string |
このフィールドにはマーカーのサイズを指定をします。 “N”ピクセル数、または、“Nc”センチメートル単位の距離、または、”Ni”インチ単位の距離、または、”Nm”ミリメートル単位の距離、または、”Np”プリンタポイントの距離。 注:上記全てオプションで、”N”は数値を表しています。 |
|
| fill |
string |
このフィールドにはマーカーの塗りつぶし色を指定をします。上記のcolor_specを参照してください。 |
|
| symbol |
string |
“square” または “circle” または “diamond” または “plus” または “cross” または “splus” または “scross” または “triangle” |
|
| mapy |
string |
どちらのy軸を使用するか、即ち、”y”(左側)または”y2” (右側)を指定。 |
|
| smooth |
string |
線の描画のスムーズさ:"linear" | "step" |"natural" | "quadratic" |
"linear" |
bar_table このテーブルは棒グラフに描画されるバーのプロパティを指定するために使用されます。これはgraph_inputテーブルにあるテーブル内フィールドです。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| title |
string |
線のタイトル(オプション) |
“barN” |
| xdata |
table |
数値インデックスと対応する数値を持つテーブル(必須) |
|
| ydata |
table |
数値インデックスと対応する数値を持つテーブル(必須) |
|
| option |
table |
bar_option_table |
|
bar_option_table このテーブルは棒グラフに描画されるバーのプロパティを指定するために使用されます。これはbar_table内のフィールドです。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| barwidth |
number |
バーの幅をX軸に沿った単位で指定します。 |
|
| foreground |
string |
color_spec:既知の色の名前または色の16進値の文字列。 例:”#rrggbb”、ここで、”rr”、”gg”および”bb”にはそれぞれ赤、緑および青の16進表現を指定します。 |
|
| background |
string |
上記のcolor_specを参照してください。 |
|
| mapy |
string |
どちらのy軸を使用するか、即ち、”y”(左側)または”y2” (右側)を指定。 |
|
axis_table このテーブルは、2Dプロット上に描画される軸のプロパティを指定するために使用されます。これはgraph_inputテーブルにあるテーブル内フィールドです。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| title |
string |
軸のタイトル(オプション) |
|
| titlecolor |
string |
color_spec:既知の色の名前または色の16進値の文字列。 例:”#rrggbb”、ここで、”rr”、”gg”および”bb”にはそれぞれ赤、緑および青の16進表現を指定します。 |
|
| logscale |
string |
軸の対数スケーリングの”on”または”off” |
“off” |
例:
position = {1,2,3,4,5}
pressure = {1,5,6,2,.5}
graph_table = {
title = "Axial Variation of Pressure",
grid = {},
background = "white",
plotbackground = "gray",
line = {
{
title = "Pressure",
xdata = position, --table of x-axis positions
--table of corresponding y-axis positions
ydata = pressure,
option = {
fill = "red",
symbol = "diamond"
},
},
x_axis = {
title = "Axial Position",
titlecolor = "black“
},
y_axis = {
title = "Pressure",
titlecolor = "black"
}
}
graph_handle = graph(graph_table) -- create 2D plot
postscript_output(graph_handle, output_file_name, postscript_output_options_table) この関数を使用すると、グラフをポストスクリプトファイルとして保存することができます。入力引数はグラフのハンドルを保持する変数、出力ファイル名、および、ポストスクリプト出力オプションを指定するテーブルです。
postscript_output_options_table このテーブルは関数postscript_output()の引数でポストスクリプトオプションを指定します。 |
| 入力フィールド |
データ型 |
コメント |
デフォルト値 |
| center |
string |
“on” または “off” グラフをページ中央に配置 |
“on” |
| colormode |
string |
“color” または “gray” または “mono” |
“color” |
| decorations |
string |
“on” または “off” 背景と境界を描画するオプション。注:白い背景を強制的に印刷するには”off”に設定します。 |
“on” |
| landscape |
string |
“on” または “off” “off”を選択すると、出力は“portrait”(縦向き)になります。 |
“off” |
| maxpect |
string |
“on” または “off” “on”の場合、グラフはアスペクト比を維持しながらページに収まる最大サイズに縮尺されます。 |
“off” |
| width |
string |
“N”ピクセル数、または、“Nc”センチメートル単位の距離、または、”Ni”インチ単位の距離、または、”Nm”ミリメートル単位の距離、または、”Np”プリンタポイントの距離。 注:上記全てオプションで、”N”は数値を表しています。 |
スクリーン上のサイズ |
| height |
string |
“N”ピクセル数、または、“Nc”センチメートル単位の距離、または、”Ni”インチ単位の距離、または、”Nm”ミリメートル単位の距離、または、”Np”プリンタポイントの距離。 注:上記全てオプションで、”N”は数値を表しています。 |
スクリーン上のサイズ |
例:
graph_handle = graph(graph_table)
--set output specifications
postscript_output_options_table = {
colormode = "gray",
landscape="off",
maxpect="off",
width="6i", --set width to six inches
height="8i" –-set height to eight inches
}
--set output file name
outfile = "graph.ps"
--output postscript file
postscript_output(graph_handle,outfile, postscript_output_options_table)
|