3

Cairo デバイスでフォント サイズを設定しようとしていますが、pointsize引数はフォント サイズではなく、プロット内のポイントのサイズを設定しているようです。私はこのMWEを持っています:

\documentclass{article}
\begin{document}
<<setup>>=
library(maptools)
data(meuse)
coordinates(meuse) <- c("x", "y")
proj4string(meuse) <- CRS("+init=epsg:28992")
@

<<fig1, dev='cairo_pdf', dev.args=list(family ="CMU Serif", pointsize=12), fig.keep='last'>>=
plot(meuse, pch=16)
legend("topleft", "Example Text")
@
<<fig2, dev='cairo_png',fig.ext='png',dev.args=list(family ="CMU Serif", pointsize=2), fig.keep='last'>>=
plot(meuse, pch=16)
legend("topleft", "Example Text")
@
\end{document}

fig1には大きな点と通常のテキストがあり、fig2同じテキストですが小さな点があります。図1 図2

4

1 に答える 1

1

R ベースのグラフィックスでは、通常、フォント サイズは引数で設定されますcex(.something)。この特定のケースでは、関数のcex引数を使用できます。legend()

plot(meuse, pch=16)
legend("topleft", "Example Text", cex=2)
于 2013-05-15T10:28:32.397 に答える