Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. documentclass{scrartcl}
  2. usepackage{caption,subcaption}
  3. usepackage{pgfplots}
  4. pgfplotsset{
  5. compat=1.3,
  6. }
  7.  
  8. %Maintenance Subskala Kreuztabelle
  9.  
  10. begin{filecontents*}{data.txt}
  11. Name x niedrige st1 hohe st2
  12. niedrig$:$Traumabelastung 1 22.2 0 14.8 0
  13. hohe$:$Traumabelastung 2 23.1 0 18.8 0
  14.  
  15. end{filecontents*}
  16.  
  17. begin{document}
  18.  
  19. begin{figure}
  20.  
  21.  
  22. begin{tikzpicture}
  23. begin{axis}[
  24. title=A,
  25. bar width=50pt,
  26. ybar=0pt,
  27. ylabel={% Abbrecher},
  28. ymin=0,
  29. ymax=40,
  30. enlarge x limits=0.5,
  31. width=11cm,
  32. height=8cm,
  33. xticklabels from table={data.txt}{Name},
  34. xtick=data,
  35. xlabel near ticks,
  36. % extra x ticks={0.82, 1.5}, % I want to label bars with some extra numbers here therefore I need to move down "niedrige/hohe Traumabelastung".
  37. % extra x tick style={yshift=10mm, major tick length=0pt,
  38. % },
  39. % extra x tick labels={
  40. % textbf{2},
  41. % textbf{10}
  42. % },
  43. ticklabel style={/pgf/number format/.cd, use comma, 1000 sep = {}},
  44. nodes near coords,
  45. every node near coord/.append style={
  46. yshift=transformdirectiony(myshift+1.5),
  47. anchor=north,
  48. rotate=0,
  49. font=scriptsize
  50. },
  51. ymajorgrids=true,
  52. legend pos= north west,% Legende oben links in Abb.
  53. legend cell align=left% Rechtsbündige Ausrichtung der Legende
  54. ]
  55. addplot
  56. [draw = black,
  57. fill = gray!30!white,
  58. error bars/.cd,
  59. y dir=both,
  60. y explicit,
  61. % error mark=triangle*,
  62. error bar style={color=black}]
  63. table[
  64. x=x,
  65. y=niedrige,
  66. y error=st1,
  67. visualization depends on=1.25*thisrow{st1} as myshift,
  68. ]
  69. {data.txt};
  70. addlegendentry{niedrige Maintenance};
  71. addplot
  72. [draw = black,
  73. fill=white,
  74. error bars/.cd,
  75. y dir=both,
  76. y explicit,
  77. % error mark=triangle*,
  78. error bar style={color=black}]
  79. table[
  80. x=x,
  81. y=hohe,
  82. y error=st2,
  83. visualization depends on=1.25*thisrow{st2} as myshift,
  84. ]
  85. {data.txt};
  86. addlegendentry{hohe Maintenance};
  87.  
  88. end{axis}
  89.  
  90. end{tikzpicture}
  91.  
  92. caption{Abbrecherquoten der verschiedenen Gruppen. Es werden Abbrecherquoten in Prozent und 95% Konfidenzintervalle f"ur drei Gruppen f"ur hohe Traumabelastung und niedrige Traumabelastung unterteilt nach niedrigem und hohem Motivationswert angegeben. Zahlen unterhalb der Balken geben die Anzahl der Patienten in der jeweiligen Gruppe an. textbf{A}) Maintenance Subskala, textbf{B}) Contemplation Subskala, textbf{C}) RTC Wert.}
  93.  
  94. end{figure}
  95.  
  96.  
  97. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement