如何让图形变大

如何让图形变大

我制定了以下语法:

\begin{figure}[ht]
\caption{xxx }
\centering
<<echo=FALSE,fig=TRUE >>=
load("//d049nt01/estudios$/Indicadores de Liquidacion/Tablas de prueba/pago_agg.rda")
jub <- pago_agg[c(1:10),]
jub$RACSCODIGO <- as.numeric(jub$RACSCODIGO)
jub <- jub[with(jub, order(RACSCODIGO)),]

par(mar = c(5, 4, 4, 4) + 0.3) 
barplot(jub$HAB_MED)
par(new = TRUE)
plot(jub$RACSCODIGO, jub$CANT, type = "l", axes = FALSE, bty = "n", xlab = "", ylab = "Monto de Jubilación en pesos")
points(jub$CANT)
text( jub$RACSCODIGO, jub$CANT, jub$CANT, pos = 3)
axis(side=4, at = pretty(range(jub$CANT)))
mtext("Cantidad de Solicitudes con Jubilación", side=4, line=3)
@

\end{figure} 

我想按比例放大 PDF 中的图形,但不将其视为图像,例如 .jpg、.png 等。

编辑-可重现的例子

\documentclass{report}
\usepackage{pdflscape} 
\usepackage[spanish]{babel}
\usepackage{caption}
\usepackage{graphicx}
\pagestyle{empty} 
\begin{document}
\SweaveOpts{concordance=TRUE}

\begin{landscape}
\begin{figure}[ht]
\caption{Test}
\centering
<<echo=FALSE,fig=TRUE >>=
barplot(rnorm(10,0,1),rnorm(10,0,1))
@
\end{figure}
\end{landscape}

\end{document}

答案1

当我让图形与文本具有相同的宽度时,我遇到了类似的问题,因为 Sweave 中图形的默认大小是线宽的 0.8。为了解决这个问题,我不得不在 \begin{document} 之后但在进行图形调用之前手动设置值。

\setkeys{Gin}{width=\textwidth}

如果这是我们所寻找的,请告诉我。

答案2

这是来自 R 项目的文件。您可以使用 将其编译为 pdf Sweave("path/to/your/file.Rnw")。这将生成一个包含图形的新 .df 文件。现在您可以使用命令将此 pdf 包含在您的文档中\includegraphics

\includegraphics[scale=0.5]{path/to/the/generated/file.pdf}

\includegraphics有比例、宽度或高度等选项。您可以使用这些选项调整图像大小。

相关内容