Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]
  2. documentclass[a4paper,12pt]{article}
  3. usepackage{pgfplots,filecontents}
  4.  
  5. begin{filecontents*}{data.csv}
  6. "Amplitude","notes: data set 1",
  7. X,Y,
  8. 1,1,
  9. 2,2,
  10. 3,3,
  11. 4,4,
  12.  
  13. "Amplitude","notes: data set 2",
  14. X,Y,
  15. 1,7,
  16. 2,6,
  17. 3,5,
  18. 4,4,
  19. 5,3,
  20. 6,2,
  21. 7,1,
  22.  
  23. "CH1","notes: data set 1",
  24. "CH1","notes: data set 2",
  25. end{filecontents*}
  26.  
  27. begin{document}
  28. begin{tikzpicture}
  29. begin{axis} [width=0.5textwidth,height=7cm,
  30. ]
  31. addplot gnuplot [raw gnuplot, mark=none, black]{
  32. set datafile separator comma;
  33. plot "<(sed -n '3,6p' data.csv)" using 1:2 with lines;
  34. };
  35. addplot gnuplot [raw gnuplot, mark=none, red]{
  36. set datafile separator comma;
  37. plot "<(sed -n '10,16p' data.csv)" using 1:2 with lines;
  38. };
  39. end{axis}
  40. end{tikzpicture}
  41. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement