I'm using TeX 3.14159265 (TeX Live 2015/Debian) on Ubuntu 16.04 LTS with frontend as Texmaker 4.4.1.

I used matlabfrag script to produce an eps file to be used with psfragfig in pdflatex. The EPS file is basically a Matlab semilog plot of two spectra. I've successfully used other plots in my documents using this technique of matlabfrag, with only difference that they are linear scale plots & not log plots

However for log plots I get a graphics processing error with this warning:

Package pstool Warning: Execution failed during process: latex -shell-escape -output-format=dvi -output-directory="./" -interaction=ba tchmode "f068a10019aalldatap5_spec-pstool.tex"

The companion tex file to .eps reads as:

% Generated using matlabfrag
% Version: v0.7.0devb04
% Version Date: 30-May-2013
% Author: Zebb Prime
%% <text>
\psfrag{014}[tc][tc]{\matlabtextA Frequency, f(Hz)}%
\psfrag{015}[bc][bc]{\matlabtextA S(f) (m^2)}%
%% </text>
%% <xtick>
\psfrag{000}[ct][ct]{\matlabtextA $0$}%
\psfrag{001}[ct][ct]{\matlabtextA $0.5$}%
\psfrag{002}[ct][ct]{\matlabtextA $1$}%
\psfrag{003}[ct][ct]{\matlabtextA $1.5$}%
\psfrag{004}[ct][ct]{\matlabtextA $2$}%
\psfrag{005}[ct][ct]{\matlabtextA $2.5$}%
%% </xtick>
%% <ytick>
\psfrag{006}[rc][rc]{\matlabtextA 10^{-11}}%
\psfrag{007}[rc][rc]{\matlabtextA 10^{-10}}%
\psfrag{008}[rc][rc]{\matlabtextA 10^{-9}}%
\psfrag{009}[rc][rc]{\matlabtextA 10^{-8}}%
\psfrag{010}[rc][rc]{\matlabtextA 10^{-7}}%
\psfrag{011}[rc][rc]{\matlabtextA 10^{-6}}%
\psfrag{012}[rc][rc]{\matlabtextA 10^{-5}}%
\psfrag{013}[rc][rc]{\matlabtextA 10^{-4}}%
%% </ytick>

I've tried to change log labels to, say for example, \matlabtextA $10^{-5}$ instead of the above as shown. The sample eps file can be found here.

The pstool (f068a10019aalldatap5_spec-pstool.tex) file reads as

\pdfoutput =0\relax 


\pagestyle {empty}

\def \thepage {\csname @arabic\endcsname \c@page }
\setcounter {page}{1}
\@input {samplepsfrag.oldaux}

\begin {document}
\immediate \write \@mainaux {\@percentchar <*PSTOOLLABELS>}

\centering \null \vfill 

\csname @input\endcsname {f068a10019aalldatap5_spec.tex}
 \includegraphics [width=0.45\textwidth ] {f068a10019aalldatap5_spec}


\immediate \write \@mainaux {\@percentchar </PSTOOLLABELS>}
\end {document}

The following is the code for SWE





            \\ \footnotesize{(a)}

1 Answer 1


The problem can be located in \psfrag{015}[bc][bc]{\matlabtextA S(f) (m^2)}% and likewise every line using circumflex('^')

The usage of circumflex should be in math mode like \psfrag{015}[bc][bc]{\matlabtextA S(f) ($m^2$)}%. Similarly, the labels of the log plot should read as \psfrag{006}[rc][rc]{\matlabtextA $10^{-11}$}% and likewise

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .