Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{pgfplots}
  3. pgfplotsset{compat=newest}
  4. usepgfplotslibrary{groupplots}
  5.  
  6.  
  7. newcommand{datapthreeone}{prob3.dat}
  8. begin{filecontents*}{datapthreeone}
  9. x1 y1 averX averY Ex Ey
  10. 2.000, 3.000, -0.714, 1.000, 1.000, -0.714
  11. 1.000, 2.000, -1.714, 0.000, 0.000, -1.714
  12. 1.000, 1.000, -1.714, -1.000, -1.000, -1.714
  13. 2.000, 2.000, -0.714, 0.000, 0.000, -0.714
  14. 4.000, 2.000, 1.286, 0.000, 0.000, 1.286
  15. 4.000, 3.000, 1.286, 1.000, 1.000, 1.286
  16. 5.000, 1.000, 2.286, -1.000, -1.000, 2.286
  17. end{filecontents*}
  18.  
  19. begin{document}
  20. begin{figure}
  21. begin{center}
  22. begin{tikzpicture}
  23. begin{groupplot}[group style={group size=2 by 2, horizontal sep=4em, vertical sep=5em}]
  24. nextgroupplot[xmin=-2, xmax=2, ymin=-2.5, ymax=2.5, legend style={font=fontsize{7}{9}selectfont}, title = (c) PCA Projection Points]
  25. addplot [only marks, line width = 0.3mm, mark=x, blue, mark options={scale=1.2}]table[x index=4, y index=5, only marks,col sep=comma] {datapthreeone}; addlegendentry{emph{Projected Data}}
  26. addplot [-latex, dashed, blue, domain=-2:2, samples=2]{0*x + 0};
  27. addplot[-latex, dashed]coordinates {(-3,0) (2.5,0)};
  28. addplot[-latex, dashed]coordinates {(0,-2.5) (0,2.5)};
  29.  
  30. nextgroupplot[xmin=-2, xmax=2, ymin=-2.5, ymax=2.5, legend style={font=fontsize{7}{9}selectfont}, title = (c) PCA Projection Points]
  31. addplot [only marks, line width = 0.3mm, mark=x, blue, mark options={scale=1.2}]table[x index=4, y index=5, only marks,col sep=comma] {datapthreeone}; addlegendentry{emph{Projected Data}}
  32. addplot [-latex, dashed, blue, domain=-2:2, samples=2]{0*x + 0};
  33. addplot[-latex, dashed]coordinates {(-3,0) (2.5,0)};
  34. addplot[-latex, dashed]coordinates {(0,-2.5) (0,2.5)};
  35.  
  36. end{groupplot}
  37.  
  38. end{tikzpicture}
  39. end{center}
  40. end{figure}
  41.  
  42. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement