X-Received: by 10.224.112.133 with SMTP id w5mr8571559qap.5.1379881567438; Sun, 22 Sep 2013 13:26:07 -0700 (PDT) X-Received: by 10.49.72.65 with SMTP id b1mr1383qev.21.1379881567369; Sun, 22 Sep 2013 13:26:07 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!d5no1527284qap.0!news-out.google.com!gv3ni1143qab.0!nntp.google.com!d5no1527279qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Sun, 22 Sep 2013 13:26:06 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.207.177.152; posting-account=eDmu7QoAAADv0Pu-8YzAIWuwKniuf8Tq NNTP-Posting-Host: 71.207.177.152 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6ce735c9-dfd4-45df-8423-8eb909d4de34@googlegroups.com> Subject: python, pythontex and plots From: chitturk@uah.edu Injection-Date: Sun, 22 Sep 2013 20:26:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:54598 \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{wrapfig} % Allows in-line images \usepackage{pythontex} \setpythontexworkingdir{.} \begin{document} This is an example of using pythontex \begin{pycode} import pylab as p import numpy as np x = np.linspace(0.0,1.0,10) y = 2.0*x + 5.0 xmax = max(x) ymax = max(y) p.plot(x,y) outputfile = 'myplot.png' p.savefig(outputfile) p.clf() \end{pycode} % this works fine, I can print the name of the output file, variables The plot is named \py{outputfile}, the max in x was \py{xmax} and \py{ymax} % now I would like to plot it, this works \includegraphics[scale=0.75]{myplot.png} % but when I do this %\includegraphics[scale=0.75]{\py{outputfile}} % I get %! File ended while scanning definition of \filename@base. % % } % no pdf \end{document}