1

私はRに次のプロットを持っています:

x = c(0, 1e-10, 1e-08, 1e-06, 1e-05, 0.001, 0.1);
y = c(22000, 21490, 17252, 9204, 6118, 5092, 4998);
z = c(85.59, 85.59, 85.58, 85.49, 85.29, 85.29, 85.29);

x1 = c(0, 1e-10, 1e-08, 1e-06, 1e-05, 0.001, 0.1);
y2 = c(22000, 20039, 15185, 7705, 5436, 5223, 4933);
z2 = c(85.59, 85.59, 85.58, 85.53, 85.46, 85.49, 85.49);

y = y / 60;

y2 = y2 / 60;


x = log(x);

par("mar")
par(mar = c(par("mar")[1:3], 5.1))

plot(x,y, type="n", lwd=4, ylab="", xlab="threshold", xaxt="n",yaxt="n")

axis(1,lwd=4)
axis(2,lwd=4)

points(x, y, type = "l", lwd=4)

points(x, y, col="red", cex=2, pch=19)

points(x, y2, lwd=4, type="o", lty=2, col="black");

points(x, y2, col="red", cex=2, pch=19);

par("usr")
par(usr = c(par("usr")[1:2], 84,86))

axis(4, lwd=4)
points(x, z, type="l", lwd=4)

points(x, z, col="blue", cex=2, pch=15)

points(x, z2, type="l", col="black", lty=2, lwd=4)

points(x, z2, col="blue", cex=2, pch=15)


mtext("Measure1", side = 4, col = "blue",line=3)
mtext("Measure2", side = 2, col = "red",line=3)

それは私にとってほぼ完璧ですが、私は次のことに従ってそれを微調整したいと思います:

  1. 左のy軸とx軸-これらは太字ですが、何らかの理由で、太字の部分が軸全体に伸びていません。

  2. 数字とラベルのフォントを少し大きくして、太字のフォントで表現したいと思います。

  3. フォントをTimesに変更したいと思うかもしれませんが、オンラインで見たものからすると、かなり面倒なように思えます。

ありがとう!

4

1 に答える 1

0

上記のコメントで@thelatemailが述べているように、最初の質問は関数で答えることができますbox

box(lwd=4)

軸のある辺だけを太字にしたい場合は、btyパラメータを追加します。

box(lwd=4, bty="u") # For all the different kind of boxes see ?par.

ラベルのフォントとサイズを変更するには、andステートメントでパラメータfontおよびcex.lab/を使用する必要があります。cex.axisplotaxis

axis(1, font=2, cex.axis=1.1) #font=2 correspond to bold face. See ?par for more information

最後に、フォントについては、引数を使用できますがfamily、すべての種類の出力デバイスで動作が異なります。このテーマの詳細については?x11この回答の「フォント」セクションを参照してください。

axis(1, family="Times") #This will work with Cairo devices for example.

cex.axisこれは、1.1で設定された、太字のフォントと太字のU字型のボックス、およびTimesフォント のプロットです。ここに画像の説明を入力してください

于 2012-08-03T09:14:14.977 に答える