0

I have been trying to find a way to add axis ticks and axis label on a PDF. Thus far I have only found a way to add the axis label. Could someone help me?

I am trying to go from this:

enter image description here

to axis ticks, looking like this:

enter image description here

The code I am using right now:

\begin{figure}[htb]
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}
  \node (img)  {\includegraphics[scale=0.225]{example-image}};
  \node[below=of img, node distance=0cm, yshift=1cm,font=\color{red}] {x-axis};
  \node[left=of img, node distance=0cm, rotate=90, anchor=center,yshift=-0.7cm,font=\color{red}] {y-axis};
 \end{tikzpicture}
\end{minipage}%
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}
  \node (img)  {\includegraphics[scale=0.225]{aa12.pdf}};
  \node[below=of img, node distance=0cm, yshift=1cm,font=\color{black}] {x-axis};
  \node[left=of img, node distance=0cm, rotate=90, anchor=center,yshift=-0.7cm,font=\color{red}] {y-axis};

\end{tikzpicture}
\end{minipage}%
\end{figure}
2
  • 3
    Welcome! Look at section 4.3.7 Using External Graphics as Plot Sources of the pgfplots manual v1.17.
    – user194703
    May 27, 2020 at 15:39
  • Have you considered to use the pgfplots package to print the plot directly in latex? Otherwise, I can only suggest to make the plot with the axis in a separate program because you'll never get the scaling correct if you only attach an axis separately to a plot.
    – Steradiant
    May 27, 2020 at 15:40

0

You must log in to answer this question.

Browse other questions tagged .