2017-06-22 43 views
0

我正在使用R Sweave,但r不會生成此圖。軟件包中可能存在衝突或不相關。這是錯誤。請參閱第73行,在{練習I}部分,注意在塊中我使用fig = TRUE。附上了我的代碼。R sweave不打印圖

\documentclass[10 pt]{article} 
\usepackage[spanish,activeacute]{babel} 
\usepackage[latin1]{inputenc} 
\usepackage{amsmath, amssymb, amsthm, latexsym, graphics, graphpap, layout, multicol, enumerate} 
\usepackage{graphicx,color} 
\DeclareGraphicsExtensions{.eps} 
\usepackage{geometry} 
\usepackage{pstricks-add} 
\geometry{verbose} 
\usepackage{movie15} 
\usepackage{hyperref} 
\usepackage{fancyhdr} 

\hypersetup{bookmarksopen,bookmarksnumbered,colorlinks,linkcolor=blue,legalpaper,pagebackref,pdftitle=Parcial 1 Varias Variables,pdfauthor=Wilmer Pineda,pdfsubject=álgebra,pdfkeywords=álgebra} 
\parindent=0pt 
\definecolor {este}{gray}{0.9} 
\definecolor{otro}{rgb}{0.56,0.65,0.76} 
\definecolor{light-gray}{gray}{0.93} 
\renewcommand\tablename{Tabla} 
\theoremstyle{plain} 
\newtheorem{prop}{Proposición}[section] 
\newtheorem{teo}[prop]{Teorema} 
\newtheorem{cor}[prop]{Corolario} 
\newtheorem{lem}[prop]{Lema} 
\theoremstyle{definition} 
\newtheorem{defi}{Definición}[section] 
\newtheorem{ejem}{Ejemplo}[section] 
\theoremstyle{remark} 
\newtheorem*{nota}{Nota} 
\newtheorem*{notac}{Notación} 
\makeatletter 
\newenvironment{tablaqui} 
    {\def\@captype{table}} 
    {} 
\newenvironment{figuraqui} 
    {\def\@captype{figure}} 
    {} 
\makeatother 
\pagestyle{fancy} 
\headheight=80pt %para cambiar el tamaño del encabezado 
\fancyhead[L] %la "L" indica a la izquierda 
{ 
\begin{minipage}{2cm} 
%\includegraphics[width=\textwidth]{LogoEAN.eps} 
\end{minipage} 
} 
\fancyhead[C] %la "C" indica al centro 
{ 
\textbf 
{Parcial 4}} %textsf es un tipo de letra 

\fancyhead[R] %la "R" indica a la derecha 
{\begin{minipage}{5cm} 
\begin{flushright} 
Wilmer Pineda\\ 
Fundamentos Sistemas Continuos Gr. 1\\ 
13 de Junio de 2017 
\end{flushright} 
\end{minipage} 
} 
%\title{\textbf{Parcial 2}} 
%\author{Carlos Isaac Zainea\\ Álgebra Lineal \\ Universidad Francisco José de Caldas} 
%\date{25 de Abril de 2013} 

\begin{document} 
\SweaveOpts{concordance=TRUE} 

Este es un examen \textbf{individual}. No se permite el uso de libros, apuntes o cualquier medio electrónico. Los celulares deben estar \textbf{apagados} durante todo el examen. Las respuestas deben estar justificadas. 

\section*{Ejercicio I} 
Encuentre la longitud de la gráfica $x=\frac{1}{3}\sqrt{y}(y-3)$ en el intervalo [1,9]. 

\begin{figure}[h] 
\caption{Gráfica ejercicio 1.} 
<<fig=TRUE,echo=FALSE>>= 
y=seq(1,9,0.01) 
x=(1/3)*sqrt(y)*(y-3) 
plot(x,y,type="l") 
@ 
\end{figure} 

\section*{Ejercicio II} 
Encuentre el área de la superficie que se forma al girar la gráfica de $x=\frac{1}{3}(y^2+2)^{3/2}$ en el intervalo $1\leq y \leq 2$ alrededor del eje $x$. 

\section*{Ejercicio III} 
Calcular las coordenadas del centro de masa del área comprendida entre las parábolas $y^2=x$ y $x^2=-8y$. 

\section*{Ejercicio IV} 
Un tanque tiene la forma de un cono circular invertido con longitud $10m$ y radio de la base $4m$. Se llena de agua hasta una altura de $8m$. Encuentre el trabajo requerido para vaciar el tanque bombeando toda el agua a la parte superior del tanque. (La densidad del agua es $1000kg/m^3$) 

\section*{Ejercicio V} 
Encuentre el volumen del sólido obtenida al girar la región comprendida entre $y=1+\sec(x)$ y $y=3$ alrededor de la recta $y=1$. 

\section*{Ejercicio VI} 
Las curvas de las funciones seno y coseno se intersecan infinitas veces, dando lugar a regiones de igual área. Calcular el área de una de dichas regiones. 

\end{document} 

具體而言,這是生成錯誤

\begin{figure}[h] 
\caption{Gráfica ejercicio 1.} 
<<fig=TRUE,echo=FALSE>>= 
y=seq(1,9,0.01) 
x=(1/3)*sqrt(y)*(y-3) 
plot(x,y,type="l") 
@ 
\end{figure} 

回答

0

行的問題是,你正在使用.EPS擴展,所以你應該使用下面的代碼。

\DeclareGraphicsExtensions{.eps} 

\begin{figure}[h] 
\caption{Gráfica ejercicio 1.} 
<<fig=TRUE,echo=FALSE, pdf=FALSE, eps=TRUE, png=TRUE>>= 
y=seq(1,9,0.01) 
x=(1/3)*sqrt(y)*(y-3) 
plot(x,y,type="l") 
@ 
\end{figure}