Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. documentclass[varwidth=false, border=2pt]{standalone}
  2. usepackage[utf8]{inputenc} % this is needed for umlauts
  3. usepackage[ngerman]{babel} % this is needed for umlauts
  4. usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  5. usepackage[margin=2.5cm]{geometry} %layout
  6.  
  7. usepackage{pgfplots}
  8. usepgfplotslibrary{dateplot}
  9. usetikzlibrary{pgfplots.dateplot}
  10.  
  11. begin{document}
  12. begin{tikzpicture}
  13. begin{axis}[
  14. date coordinates in=x,
  15. xticklabel={year},
  16. x tick label style={align=center, rotate=45},
  17. yticklabel=$pgfmathprintnumber{tick}$,%,
  18. date ZERO=1946-06-30,
  19. xmin={1946-01-01},
  20. xmax={2010-01-01},
  21. extra y ticks={5},
  22. /pgfplots/ytick={0,10,...,100},
  23. ymin=0, ymax=100,
  24. width=15cm, height=8cm, % size of the image
  25. grid = major,
  26. grid style={dashed, gray!30},
  27. legend style={at={(1.15,1)}, anchor=north}
  28. ]
  29. addplot[blue, dashed, mark=triangle*] table [x=Wahltag, y=Wahlbeteiligung, col sep=comma] {landtagswahlen-in-bayern.csv};
  30. addplot[black,mark=square*] table [x=Wahltag, y=CSU, col sep=comma] {landtagswahlen-in-bayern.csv};
  31. addplot[red,mark=square*] table [x=Wahltag, y=SPD, col sep=comma] {landtagswahlen-in-bayern.csv};
  32. addplot[green,mark=square*] table [x=Wahltag, y=GRÜNE, col sep=comma] {landtagswahlen-in-bayern.csv};
  33. addplot[yellow,mark=square*] table [x=Wahltag, y=FDP, col sep=comma] {landtagswahlen-in-bayern.csv};
  34. legend{Wahlbeteiligung,CSU,SPD,Grüne,FDP}
  35. end{axis}
  36. end{tikzpicture}
  37. end{document}
  38.  
  39. documentclass[varwidth=false, border=2pt]{standalone}
  40. usepackage[utf8]{inputenc} % this is needed for umlauts
  41. usepackage[ngerman]{babel} % this is needed for umlauts
  42. usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  43. usepackage[margin=2.5cm]{geometry} %layout
  44.  
  45. usepackage{pgfplots}
  46. usepgfplotslibrary{dateplot}
  47. usetikzlibrary{pgfplots.dateplot}
  48.  
  49. begin{document}
  50. begin{tikzpicture}
  51. begin{axis}[
  52. date coordinates in=x,
  53. xticklabel={year},
  54. x tick label style={align=center, rotate=45},
  55. yticklabel=$pgfmathprintnumber{tick}$,%,
  56. date ZERO=1946-06-30,
  57. xtick={1946-01-01,1950-01-01,1954-01-01,1958-01-01,1962-01-01,1966-01-01,1970-01-01,1974-01-01,
  58. 1978-01-01,1982-01-01,1986-01-01,1990-01-01,1994-01-01,1998-01-01,2002-01-01,2006-01-01,2010-01-01},
  59. xmin={1946-01-01},
  60. xmax={2010-01-01},
  61. extra y ticks={5},
  62. /pgfplots/ytick={0,10,...,100},
  63. ymin=0, ymax=100,
  64. width=15cm, height=8cm, % size of the image
  65. grid = major,
  66. grid style={dashed, gray!30},
  67. legend style={at={(1.15,1)}, anchor=north}
  68. ]
  69. % addplot[blue, dashed, mark=triangle*] table [x=Wahltag, y=Wahlbeteiligung, col sep=comma] {landtagswahlen-in-bayern.csv};
  70. % addplot[black,mark=square*] table [x=Wahltag, y=CSU, col sep=comma] {landtagswahlen-in-bayern.csv};
  71. % addplot[red,mark=square*] table [x=Wahltag, y=SPD, col sep=comma] {landtagswahlen-in-bayern.csv};
  72. % addplot[green,mark=square*] table [x=Wahltag, y=GRÜNE, col sep=comma] {landtagswahlen-in-bayern.csv};
  73. % addplot[yellow,mark=square*] table [x=Wahltag, y=FDP, col sep=comma] {landtagswahlen-in-bayern.csv};
  74. % legend{Wahlbeteiligung,CSU,SPD,Grüne,FDP}
  75. end{axis}
  76. end{tikzpicture}
  77. end{document}
  78.  
  79. Package pgfplots notification 'compat/show suggested version=true': document ha
  80. s been generated with the most recent feature set (pgfplotsset{compat=1.10}).
  81.  
  82. PGFPlots: reading {landtagswahlen-in-bayern.csv}
  83. ! Undefined control sequence.
  84. GenericError ...
  85. #4 errhelp @err@ ...
  86. l.32 ...sep=comma] {landtagswahlen-in-bayern.csv};
  87.  
  88.  
  89. The control sequence at the end of the top line
  90. of your error message was never def'ed. If you have
  91. misspelled it (e.g., `hobx'), type `I' and the correct
  92. spelling (e.g., `Ihbox'). Otherwise just continue,
  93. and I'll forget about whatever was undefined.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement