
Creé un gráfico usando matplotlib
Python y lo guardé en un PGF que luego incrusté en mi documento LaTeX. Me gustaría que fuera un poco más pequeño, ya que no se centra y fuerza hacia abajo el encabezado de una sección que se supone que está encima de él.
Aquí está el enlace para el archivo pgf. http://www.fast-files.com/getfile.aspx?file=191033
\documentclass[12pt]{article}
\title{COMP 2823: Assignment 1}
\author{Student ID: 480380498}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fancyhdr}
\usepackage{ulem}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\pagestyle{fancy}
\fancyhf{}
\rhead{SID: 480380498}
\begin{document}
...
\newpage
\section{}
Text \\
\begin{figure}
\begin{center}
\input{graph1.pgf}
\end{center}
\end{figure}
\end{document}
Respuesta1
Prueba con:
\documentclass[12pt]{article}
\title{COMP 2823: Assignment 1}
\author{Student ID: 480380498}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fancyhdr}
\usepackage{ulem}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\pagestyle{fancy}
\fancyhf{}
\rhead{SID: 480380498}
\begin{document}
...
\newpage% why a newpage?
\section{without title?}
Text % don't use \\, leave a blank line to create a new paragraph
\begin{center}
\resizebox{\linewidth}{!}{\input{graph1.pgf}}
\end{center}
\end{document}
(No probado porque no tengo un archivo .pgf).
Y ver también:¿Cuándo deberíamos usar \begin{center} en lugar de \centering?