グラフィックス参考実例集:プロット点のタイプ
(グラフィックス参考実例集に戻る。Rのグラフィックスパラメータを参照する。)
plot(), points() 等のグラフィックス関数による点の形状はオプション pch=n、もしくは pch="シンボル文字" で指定される。以下はそのサンプルである。
注: pch="." (ピリオッド文字)は真正のドット(指定位置にちょうど置かれる1ピクセルの点)で、文字拡大率に影響されない。これはドットをつなげて曲線を描く等に使うため、他の文字記号指定とはことなり、特別な仕様になっているらしい。
ある方からのコメント:「pch=0 は pch=22 と同じ。」 実は奇妙なことに pch="" も pch=22 と同じになります(ほとんどバグ?)。pch=21 は pch=1 と同じに見えますね(他にも同じようなシンボルがいくつか)。 更に pch=n (n=-1,-2,...) は pch=1 と同じになります。n=33,...,126 は半角 alphanumeric、そして n=161,...,255 あたりではエキゾチックな文字がでてきますよ。
pchは0〜25まで定義されているドットは特殊な処理を施している。0,22は 気持ち違う程度。 32(0x20)〜255(0xff)はそのフォントの文字(1byte)が出てくる。 デフォルトのpchは1である。 pch=NULLはデフォルトの1が割り当てられるが, pch=""は0とみなされる。ちなみに0と22では22の方が若干小さい矩形である。
| pch | 形状 |
| 0 | S square |
| 1 | S octahedron ( circle) |
| 2 | S triangle - point up |
| 3 | S plus |
| 4 | S times |
| 5 | S diamond |
| 6 | S triangle - point down |
| 7 | S square and times superimposed |
| 8 | S plus and times superimposed |
| 9 | S diamond and plus superimposed |
| 10 | S hexagon (circle) and plus superimposed |
| 11 | S superimposed triangles |
| 12 | S square and plus superimposed |
| 13 | S octagon (circle) and times superimposed |
| 14 | S square and point-up triangle superimposed |
| 15 | S filled square |
| 16 | S filled octagon (circle) |
| 17 | S filled point-up triangle |
| 18 | S filled diamond |
| 19 | R filled circle |
| 20 | R `Dot' (small circle) |
| 21 | circles |
| 22 | squares |
| 23 | diamonds |
| 24 | triangle (point up) |
| 25 | triangle (point down) |