1

How can I use \tikz to resize (scale) .eps-format picture (graph) without text and numbers inside it being resized?

PS. I have already been exposed to the same below Qs, but have problem implementing it for my case as I have .eps file and not sure what is the best option. Can anyone modify code below to work accordingly? Thanks.

Correctly scaling a tikzpicture

How to use \resizebox but not resize text (tikzpicture)

Scale tikz figure to a percentage of \textwidth

My Code needing to be changed for \tikz:

\documentclass[conference]{IEEEtran}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{array}
\usepackage{makecell, booktabs, multirow}

\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{tikzscale}
\usepackage{epstopdf}
\DeclareGraphicsExtensions{.eps}


\begin{document}
\begin{figure}[h]
\begin{center}\vspace{-0.4 cm}
{\resizebox{0.52\textwidth}{0.21\textwidth}{{\includegraphics*{Fig_11.eps}}}\vspace{-0.1 cm}
\midskip \footnotesize{\verb+      +(a)}\vspace{-0.6 cm}
\label{fig:Fig_11}
\end{center}}
\end{figure}

\end{document}

The figure also has x- and y-axis and legend.

Hans
  • 573

1 Answers1

2

In general this is not possible, it depends on the form of the letters in the EPS file. If they are already drawn as paths rather than as character data (this used to be fairly common, perhaps less so now) then it would be very hard to change as there is no easy way to distinguish the letters.

If it is simple text you may be able to edit the EPS to change the text size and position or (simpler) use the psfrag package to replace the text by latex-typeset equivalents.

Or failing that you can scale the image and the over-print it with white boxes to hide the text then over-print latex-typeset text over that.

None of these is particularly convenient, and if possible, best to go back to the original application that made the EPS and generate one at the desired size.

I don't think tikz has any features related to this problem.

David Carlisle
  • 757,742
  • the original figure is a MATLAB figure, which I converted it to eps format to preserve its pixels. I can convert matlab fig. to another format if you think it is possible in another format to utilize \tikz? – Hans Oct 03 '15 at 16:13
  • @Hans I don't see how tikz is any way related. But in matlab you have a lot of control over the formatting so you should be able to generate an image that does not need to be resized, with text of the size you need. – David Carlisle Oct 03 '15 at 16:28
  • How David? could you give an example pls. – Hans Oct 03 '15 at 16:32
  • 1
    @Hans It's off topic here, purely a matlab question but for example http://www.mathworks.com/matlabcentral/answers/101246-how-do-i-change-the-font-size-in-my-legend – David Carlisle Oct 03 '15 at 16:36