1

I am trying to modify the legend of an eps image that I generated in matlab, there are several experiments where I put the reference in the legend, so this is why I prefer to set it up with psfrag. I can modify the axis text but not the legend text. Anyone that can guide me please.

sofi
  • 11
  • 1
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 06 '24 at 07:16

1 Answers1

1

As explained in the psfrag manual, whether you can replace a string depends on how that string is encoded, you need to look into the eps, each word may appear as separate strings or with unexpected letter due to font encoding, kerning or other features of the application makeing the eps. You need to replace whatever string fragments are actually in the file, not whatever visual word appears to be in the resulting visual output.

For a legend you may find it easier not to use \psfrag but simply overlay a new legend.

\includegraphics{...}%
\begin{picture}(0,0)
\put(-10,-20){\color{white}\rule{3cm}{4cm}}
\put(-30,-40){\parbox{4cm}{some new legend text}}
\end{picture}

This overlays a white rectangle over the picture, adjust to cover up the old legend, then overlays a new parbox with whatever text you want.

David Carlisle
  • 757,742