[英]filled.contour() in R: labeling axis - cex, las, et al
I want to use filled.contour() to plot some data I have in a matrix. 我想使用fill.contour()绘制矩阵中的某些数据。
Everything is perfect until when I import the graphics into my tex file and realize I need to play with the font size for it to be readable in the final document. 一切都很完美,直到我将图形导入我的tex文件并意识到我需要使用字体大小才能在最终文档中读取它。
Unfortunately, it seems I am unable to tune the parameter cex in filled.contour(), and the same goes for las (I'd like the ylabel to be parallel to the x axis). 不幸的是,似乎我无法在filled.contour()中调整参数cex,而las也是如此(我希望ylabel与x轴平行)。
Below is a simple example. 以下是一个简单的示例。 Although I expected the output to be different in each case, namely the font size, the produced plot is pretty much the same. 尽管我期望输出在每种情况下都不同,即字体大小,但是生成的图几乎相同。
Thanks a lot for any help you can give me on this. 非常感谢您提供的任何帮助。
x=1:10
y=1:10
z=array(rnorm(100),dim=c(10,10))
filled.contour(x,y,z)
filled.contour(x,y,z,xlab='x',ylab='y')
filled.contour(x,y,z,xlab='x',ylab='y',las=1)
filled.contour(x,y,z,xlab='x',ylab='y',las=1,cex=2)
filled.contour(x,y,z,xlab='x',ylab='y',las=1,cex=20)
@QuantIbex is right, though you can also pass through other graphics parameters by specifying in the plot.title
, plot.axes
, key.title
and key.axes
arguments. @QuantIbex是正确的,但您也可以通过在plot.title
, plot.axes
, key.title
和key.axes
参数中指定来传递其他图形参数。
This is necessary because the usual graphics parameters are not passed straight through, as described in ?filled.contour
: 这是必要的,因为通常的图形参数不会直接传递,如?filled.contour
:
...: additional graphical parameters, currently only passed to
‘title()’.
Eg: 例如:
x=1:10
y=1:10
z=array(rnorm(100),dim=c(10,10))
filled.contour(x,y,z,las=0,
plot.axes={
axis(1,cex.axis=2)
axis(2,cex.axis=2)
},
plot.title={
title(xlab="x",cex.lab=2)
mtext("y",2,cex=2,line=3,las=1)
}
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.