SHARE
TWEET

Untitled

a guest Jan 12th, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. begin{filecontents*}{data.txt}
  2. a b d c
  3. 9 1 a 2  
  4. 8 2 b 4  
  5. 7 3 c 6  
  6. 6 4 d 8  
  7. 5 5 e 10  
  8. 4 6 f 12  
  9. 3 7 g 14  
  10. 2 8 x 16  
  11. 1 9 x 18  
  12. end{filecontents*}
  13. documentclass[paper=a4,ngerman,xcolor=dvipsnames]{article}
  14. usepackage[ngerman]{babel}
  15. usepackage[utf8]{inputenc}
  16. usepackage{pgfplots}
  17. pgfplotsset{compat=1.14}
  18. usepackage{siunitx}
  19. usepackage{caption}
  20. usepackage{graphicx}
  21. usepackage{lipsum}
  22.  
  23. pgfplotscreateplotcyclelist{mycolorlist}{
  24. blue!99!black,dashed,every mark/.append style={fill=blue!10!black},mark=+\
  25. red!99!black,solid,every mark/.append style={fill=blue!10!black},mark=+\
  26. green!99!black,densely dashed,every mark/.append style={fill=blue!10!black},mark=+\
  27. yellow!80!black,every mark/.append style={fill=blue!10!black},mark=+\
  28. }
  29.  
  30. defshowmark#1{tikznode[red!95!black]{pgfuseplotmark{#1}};}
  31.  
  32. begin{document}
  33. begin{figure}
  34.   begin{tikzpicture}
  35.     begin{axis}[
  36.         grid=both,
  37.         width=12cm,
  38.         height=9cm,
  39.         axis equal,
  40.         xtick pos=left,
  41.         ytick pos=left,
  42.         title style={draw,fill=none,name=legend},
  43.         title={%
  44.             showmark{pentagon*}=$SI{100}{kiloHz}$,
  45.             showmark{triangle*}=$SI{10}{kiloHz}$,
  46.             showmark{square*}=$SI{1}{kiloHz}$,
  47.             showmark{diamond*}=$SI{100}{Hz}$,
  48.             showmark{10-pointed star}=$SI{10}{Hz}$,
  49.             showmark{oplus}=$SI{1}{Hz}$,
  50.             showmark{o}=$SI{20}{mHz}$},
  51.         xlabel={R}, ylabel={Z},
  52.         legend style={at={(0.02,0.98)},anchor=north west,cells= anchor=west}},
  53.         legend style={font=footnotesize},
  54.         cycle list name=mycolorlist,
  55.         scatter,
  56.         point meta=explicit symbolic,
  57.         scatter/classes={
  58.           x={},% empty argument means: use the default style      
  59.           g={mark=pentagon*,red!95!black},
  60.           f={mark=triangle*,red!95!black},
  61.           e={mark=square*,red!95!black},
  62.           d={mark=diamond*,red!95!black},
  63.           c={mark=10-pointed star,red!95!black},
  64.           b={mark=oplus,red!95!black},
  65.           a={mark=o,red!95!black},
  66.           z={mark=*,red!80!black}
  67.           },
  68.         ]
  69.         addplot table [x=b,y=c, meta=d]{data.txt};
  70.         addplot table [x=c,y=b, meta=d]{data.txt};
  71.         addplot table [x=a,y=c, meta=d]{data.txt};
  72.         addplot table [x=b,y=a, meta=d]{data.txt};
  73.  
  74.         legend{1, 2, 3 ,4}
  75.    end{axis}
  76.   end{tikzpicture}
  77. end{figure}
  78. end{document}
RAW Paste Data
Top