Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. documentclass{article}
  2. usepackage[utf8]{inputenc}
  3. usepackage{pdflscape}
  4. usepackage[table]{xcolor}
  5. usepackage[landscape, a4paper, bottom=0.0in, margin=0in]{geometry}
  6. usepackage{pgfplots}
  7. usepackage{xcolor}
  8. usepackage{array}
  9. usepackage{caption}
  10. usepackage{subcaption}
  11.  
  12.  
  13. %Customization
  14. newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
  15. newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
  16. newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
  17. pgfplotsset{compat=newest} % Allows to place the legend below plot
  18. usepgfplotslibrary{units} % Allows to enter the units nicely
  19.  
  20.  
  21. pagenumbering{gobble}
  22. definecolor{customblue}{RGB}{21,155,151}
  23. definecolor{custompink}{RGB}{230,55,148}
  24.  
  25.  
  26. title{test}
  27. author{sinasohi}
  28. date{January 2017}
  29.  
  30. begin{document}
  31. %maketitle
  32.  
  33. include{Page1}
  34. include{Page3}
  35.  
  36. end{document}
  37.  
  38. pgfplotstableread[row sep=\,col sep=&]{
  39. interval & a & b \
  40. K74 & 32.9 & 27.5 \
  41. K76 & 23.5 & 22.5 \
  42. K75 & 25.7 & 25.0 \
  43. K77 & 22.3 & 30 \
  44. K89-90 & 30.6 & 30 \
  45. K92 & 19.3 & 15 \
  46. }mydata
  47.  
  48. pgfplotstableread[row sep=\,col sep=&]{
  49. interval & a & b \
  50. K78 & 18.8 & 20 \
  51. K85, K86, K87 & 66.3 & 60 \
  52. }yourdata
  53.  
  54. begin{figure}
  55. centering
  56. begin{minipage}{.4textwidth}
  57. caption*{textbf{Kardiovaskulære diagnoser}}
  58. begin{tikzpicture}
  59. begin{axis}[
  60. legend style={at={(0.5,1)}, text width=6em, text height=1.5ex, anchor=north,legend columns=-1},
  61. ybar,
  62. bar width=.6cm,
  63. symbolic x coords={K74,K76,K75,K77,K89-90,K92},
  64. xtick=data,
  65. ymin=0, %ymax=40,
  66. width=1textwidth,
  67. nodes near coords,
  68. every node near coord/.append style={color=black}
  69. ]
  70.  
  71. addplot[red!20!customblue,fill=customblue!80!white] table[x=interval,y=a]{mydata};
  72. addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{mydata};
  73. legend{Klinik 12345, Landsrapport}
  74. end{axis}
  75. end{tikzpicture}
  76. end{minipage}
  77. begin{minipage}{.4textwidth}
  78. caption*{textbf{Yderligere diagnoser}}
  79. begin{tikzpicture}
  80. begin{axis}[
  81. %legend style={legend columns=1,at={(1,1)},anchor=north west},
  82. legend style={at={(0.5,1)}, text width=6em, text height=1.5ex, anchor=north,legend columns=-1},
  83. ybar,
  84. bar width=.6cm,
  85. symbolic x coords={K78, {K85, K86, K87}},
  86. xtick=data,
  87. ymin=0, %ymax=40,
  88. width=1textwidth,
  89. nodes near coords,
  90. every node near coord/.append style={color=black}
  91. ]
  92.  
  93. addplot[red!20!customblue,fill=customblue!80!white] table[x=interval,y=a]{yourdata};
  94. addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{yourdata};
  95. legend{Klinik 12345, Landsrapport}
  96. end{axis}
  97. end{tikzpicture}
  98. end{minipage}
  99. end{figure}
  100.  
  101. documentclass{article}
  102. usepackage[utf8]{inputenc}
  103. usepackage{pdflscape}
  104. usepackage[table]{xcolor}
  105. usepackage[landscape, a4paper, bottom=0.0in, margin=0in]{geometry}
  106. usepackage{pgfplots}
  107.  
  108. pgfplotsset{compat=1.14} % Allows to place the legend below plot
  109. usepgfplotslibrary{
  110. units, % Allows to enter the units nicely
  111. groupplots
  112. }
  113.  
  114. definecolor{customblue}{RGB}{21,155,151}
  115. definecolor{custompink}{RGB}{230,55,148}
  116.  
  117. begin{document}
  118. pgfplotstableread[row sep=\,col sep=&]{
  119. interval & a & b \
  120. K74 & 32.9 & 27.5 \
  121. K76 & 23.5 & 22.5 \
  122. K75 & 25.7 & 25.0 \
  123. K77 & 22.3 & 30 \
  124. K89-90 & 30.6 & 30 \
  125. K92 & 19.3 & 15 \
  126. }mydata
  127.  
  128. pgfplotstableread[row sep=\,col sep=&]{
  129. interval & a & b \
  130. K78 & 18.8 & 20 \
  131. K85, K86, K87 & 66.3 & 60 \
  132. }yourdata
  133.  
  134. begin{figure}
  135. centering
  136. begin{tikzpicture}
  137. begin{groupplot}[
  138. group style={group size=2 by 1},
  139. legend style={at={(0.5,1)}, text width=6em, text height=1.5ex, anchor=north,legend columns=-1},
  140. ybar,
  141. /tikz/bar width=.6cm,
  142. xtick=data,
  143. ymin=0, %ymax=40,
  144. ,height=10cm,
  145. nodes near coords,
  146. every node near coord/.append style={color=black}
  147. ]
  148.  
  149. nextgroupplot[
  150. title=textbf{Kardiovaskulære diagnoser},
  151. width=.55textwidth,
  152. symbolic x coords={K74,K76,K75,K77,K89-90,K92}
  153. ]
  154. addplot[red!20!customblue,fill=customblue!80!white] table[x=interval,y=a]{mydata};
  155. addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{mydata};
  156. legend{Klinik 12345, Landsrapport}
  157.  
  158. nextgroupplot[
  159. symbolic x coords={K78, {K85, K86, K87}},
  160. width=.3textwidth,
  161. enlarge x limits=0.7,
  162. title=textbf{Yderligere diagnoser}
  163. ]
  164.  
  165. addplot[red!20!customblue,fill=customblue!80!white] table[x=interval,y=a]{yourdata};
  166. addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{yourdata};
  167. legend{Klinik 12345, Landsrapport}
  168. end{groupplot}
  169. end{tikzpicture}
  170. end{figure}
  171. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement