English 中文(简体)
添加备选案文[保留=真实性,比额表=0.75],以包括Sierave的图表{}
原标题:Adding options [keepaspectratio=true, scale = 0.75] to includegraphics{} in Sweave
  • 时间:2011-03-10 11:15:39
  •  标签:
  • r
  • sweave

我有以下区域法典:

<<Q1b1, fig=TRUE>>=  
qqnorm(resid(model1), main=NULL)
@

我也想在斜体字句中添加“维持轨道=真实性,比值=0.75”这一选项,以便上述R代码层产生。

egin{figure}[ht]
caption{}
egin{center}
includegraphics[keepaspectratio=true, scale = 0.75]{filename.pdf}
label{fig:1}
end{center}
end{figure}

我知道,你可以使用SweaveOpt{width=x,高=y}来具体说明出血和高温,但我要具体说明比额表,并在数字产生时保持该比例。

这样做是否容易?

增 编

问题回答

你可以为你们的每一个数字确定宽宏。 附有<代码>的关键指示文件指示。 例如,贵文件序言部分的以下各点在你网页上贴出80%的文本:

setkeys{Gin}{width=0.8	extwidth}

否则,你可以将<代码>include=FALSE的论点添加到你的代码栏目中,然后人工制作<代码>includegraphics。 缺席时,如果您的Souave档案被称作test。 Rnw,然后由密码库生成的pdf文档名称为test-Q1b1.pdf。 因此,你可以做如下事情:

<<Q1b1,fig=true,include=false,echo=false>>=  
qqnorm(rnorm(100))
@

egin{figure}[ht]
caption{}
egin{center}
includegraphics[keepaspectratio=true,scale=0.1]{test-Q1b1.pdf}
label{fig:1}
end{center}
end{figure}

然而,我已就你的例子做了一些测试,但<编码> > 尺度<>>>>参数似乎没有对此处的数字有任何影响。 但是,如<代码>angle等。

If you do not have usepackage{Sweave} in your Sweave file preamble, it will be inserted automatically as the last line before the egin{document} statement. Therefore you need to put

setkeys{Gin}{width=0.8	extwidth}

确实,这是<编码>使用包裹-Sweave}中规定的Sierave作案。

www.un.org/Depts/DGACM/index_french.htm See See See 瑞文文件(





相关问题
How to plot fitted model over observed time series

This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...

REvolution for R

since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Changing the order of dodged bars in ggplot2 barplot

I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...

Strange error when using sparse matrices and glmnet

I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...

Generating non-duplicate combination pairs in R

Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...

Per panel smoothing in ggplot2

I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...

热门标签