グラフィックス参考実例集:円、矩形等のシンボル
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
COLOR(red){SIZE(20){グラフィックス参考実例集:円、矩形等...
([[グラフィックス参考実例集]]に戻る。[[Rのグラフィックス...
COLOR(red){symbols} 関数はプロットの指定位置にシンボルを...
関数symbolsは、まずplotと同様の2変量の座標のデータをとり...
デフォルトでは、symbolsは最も大きいものが1インチになるよ...
- circles 円 半径を表すベクトル
- squares 正方形 辺の長さを表すベクトル
- rectangles 長方形 1列めが幅、2列めが辺の高さを表す行...
- stars 星 関数starsに与えるような行列(ただしすべて0以...
- thermometers 温度計 3列または4列の行列。最初の2列が幅...
- boxplots 箱ひげ図 5列の行列。最初の2列が幅と高さ、次...
ちなみに、シンボルの相対的サイズ等を追加パラメータで指定...
x <- 1:10
y <- sort(10*runif(10))
z <- runif(10)
z3 <- cbind(z, 2*runif(10), runif(10))
symbols(x, y, thermometers=cbind(.5, 1, z), inches=.5, f...
#ref(symbols1.png)
symbols(x, y, thermometers = z3, inches=FALSE)
text(x,y, apply(format(round(z3, dig=2)), 1, paste, coll...
adj = c(-.2,0), cex = .75, col = "purple", xpd=NA)
#ref(symbols2.png)
## Note that example(trees) shows more sensible plots!
N <- nrow(trees)
attach(trees)
## Girth is diameter in inches
symbols(Height, Volume, circles=Girth/24, inches=FALSE,
main="Trees' Girth")# xlab and ylab automatically
#ref(symbols3.png)
## Colors too:
palette(rainbow(N, end = 0.9))
png("symbols4.png", width=400, height=400)
symbols(Height, Volume, circles=Girth/16, inches=FALSE, ...
fg="gray30", main="symbols(*, circles=Girth/16, ...
palette("default"); detach()
#ref(symbols4.png)
終了行:
COLOR(red){SIZE(20){グラフィックス参考実例集:円、矩形等...
([[グラフィックス参考実例集]]に戻る。[[Rのグラフィックス...
COLOR(red){symbols} 関数はプロットの指定位置にシンボルを...
関数symbolsは、まずplotと同様の2変量の座標のデータをとり...
デフォルトでは、symbolsは最も大きいものが1インチになるよ...
- circles 円 半径を表すベクトル
- squares 正方形 辺の長さを表すベクトル
- rectangles 長方形 1列めが幅、2列めが辺の高さを表す行...
- stars 星 関数starsに与えるような行列(ただしすべて0以...
- thermometers 温度計 3列または4列の行列。最初の2列が幅...
- boxplots 箱ひげ図 5列の行列。最初の2列が幅と高さ、次...
ちなみに、シンボルの相対的サイズ等を追加パラメータで指定...
x <- 1:10
y <- sort(10*runif(10))
z <- runif(10)
z3 <- cbind(z, 2*runif(10), runif(10))
symbols(x, y, thermometers=cbind(.5, 1, z), inches=.5, f...
#ref(symbols1.png)
symbols(x, y, thermometers = z3, inches=FALSE)
text(x,y, apply(format(round(z3, dig=2)), 1, paste, coll...
adj = c(-.2,0), cex = .75, col = "purple", xpd=NA)
#ref(symbols2.png)
## Note that example(trees) shows more sensible plots!
N <- nrow(trees)
attach(trees)
## Girth is diameter in inches
symbols(Height, Volume, circles=Girth/24, inches=FALSE,
main="Trees' Girth")# xlab and ylab automatically
#ref(symbols3.png)
## Colors too:
palette(rainbow(N, end = 0.9))
png("symbols4.png", width=400, height=400)
symbols(Height, Volume, circles=Girth/16, inches=FALSE, ...
fg="gray30", main="symbols(*, circles=Girth/16, ...
palette("default"); detach()
#ref(symbols4.png)
ページ名: