Graphics, Figures & TablesInclusion of modified PDF

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Inclusion of modified PDF

Post by thinkpadT »

hi guys,

i have the following code

Code: Select all

\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[bitstream-charter]{mathdesign} %for a much better readable font
\usepackage{pgfplots}

\pgfplotsset{compat=newest}

\begin{document}
  \begin{tikzpicture}
    \begin{axis}[
      width=12cm, %the width of the box
      height=8cm, %the height of the box
      xlabel={Distance \lbrack $ mm $\rbrack},
      xmax=28,
      xmin=0,
      ylabel={Intensity \lbrack arb. units \rbrack}, % \lbrack a.u. \rbrack,x
      ymin=0,
      mark=none,
      legend style={
        legend pos=north east,
        font=\tiny,
        draw=none
      } % place the legend box in the right place  at ={(0.85, 0.65)}
    ]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% call data from%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      \pgfplotstableread{data.txt}  %see attachment
      \teff     
      \addplot [color = blue, mark=none, smooth, ] table[y=a] from \teff;
      \addlegendentry{Spectrum w/o  filter};
      \addplot [color = red, mark=none, smooth, ] table[y=b] from \teff;
      \addlegendentry{Spectrum with 200 nm Al filter}; each nth point=2
    \end{axis}
  \end{tikzpicture}
\end{document}
Then I edit the PDF file with Foxit Reader (see attachment), but by including the PDF via doesn't show the editing done with Foxit! :(

Code: Select all

\begin{figure}
  \centering
  \includegraphics{}
  \end{figure}
Any suggestions would be appreciated,
Thanks in advance
Attachments
data.txt
(11.67 KiB) Downloaded 204 times
both.pdf
(62.44 KiB) Downloaded 270 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Inclusion of modified PDF

Post by localghost »

No need for editing the PDF output here. You can do it all with pgfplots. The output is attached.

Code: Select all

\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\usepackage{siunitx}

\pgfplotsset{
  compat=newest,
  xlabel near ticks,
  ylabel near ticks
}

\begin{document}
  \begin{tikzpicture}[font=\small]
    \begin{axis}[
      width=12cm,
      height=8cm,
      xmax=28,
      xmin=0,
      xlabel={Distance [\si{\mm}]},
      ymin=0,
      ylabel={Intensity [arb. units]},
      mark=none,
      legend style={
        font=\tiny,
        legend cell align=left,
        legend pos=north east,
        draw=none
      }
    ]
      \pgfplotstableread{data.txt}
      \teff     
      \addplot[blue,mark=none,smooth] table[y=a] from \teff;
      \draw (axis cs:3.441,239.714) node[above,font=\footnotesize] {0-th order};
      \draw (axis cs:11.4885,70.0551) node[above,font=\footnotesize] {1};
      \draw (axis cs:12.2655,177.0355) node[above,font=\footnotesize] {2};
      \draw (axis cs:13.209,248.0586) node[above,font=\footnotesize] {3};
      \draw (axis cs:14.319,246.3357) node[above,font=\footnotesize] {4};
      \draw (axis cs:15.873,246.2327) node[above,font=\footnotesize] {5};
      \draw (axis cs:17.8155,159.3872) node[above,font=\footnotesize] {6};
      \draw (axis cs:20.646,53.7087) node[above,font=\footnotesize] {7};
      \draw (axis cs:23.754,29) node[above,font=\footnotesize] {8};
      \draw (axis cs:25.197,48.8046) node[above,font=\footnotesize] {9};
      \draw (axis cs:26.8065,50.9147) node[above,font=\footnotesize] {10};
      \addlegendentry{Without filter};
      \addplot[color=red,mark=none,smooth] table[y=b] from \teff;
      \addlegendentry{With \SI{200}{\nm} Al filter}; each nth point=2
    \end{axis}
  \end{tikzpicture}
\end{document}

Thorsten
Attachments
ytmp.png
ytmp.png (12.22 KiB) Viewed 2771 times
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Re: Inclusion of modified PDF

Post by thinkpadT »

thanks localghost,

i have used this method previously and this is very nice for presentation slides. But if you have loads of spectra this method is not very efficient i.e. time consuming. Thats why i use the direct editing via foxit.
At the moment i do export the pdf edited to png or jpeg which is working but i am not totally satisfied with the outcome.

further suggestion are still welcome :)

thanks
Post Reply