Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

15 Jul '22, 14:07

dzaic's gravatar image

dzaic
631175055

Warum wird die Jahreszahl bei pgfplots plötzlich als Float ausgegeben?

Bei der Erstellung der folgenden Abbildung wird plötzlich die Jahreszahl (Integer) als Float ausgegeben. \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usetikzlibrary{shapes,arrows, positioning} \begin{document} \begin{tikzpicture} \begin{axis}[ height=4cm, width=\textwidth, ybar, xmin = 1984, xmax = 2022, ymin = 0, ymax = 3, 3.5, xtick={1985,...,2021}, x tick label style={rotate=90, anchor=east, /pgf/number format/1000 sep=}, xtick pos=left, ylabel={Number of failures}, ytick={0,...,3}, bar width = 5pt ] \addplot coordinates { (1985, 3) (1986, 0) (1987, 0) (1988, 0) (1989, 0) (1990, 0) (1991, 0) (1992, 0) (1993, 0) (1994, 0) (1995, 0) (1996, 0) (1997, 0) (1998, 0) (1999, 2) (2000, 0) (2001, 0) (2002, 0) (2003, 0) (2004, 0) (2005, 0) (2006, 0) (2007, 0) (2008, 0) (2009, 0) (2010, 0) (2011, 0) (2012, 0) (2013, 0) (2014, 0) (2015, 0) (2016, 0) (2017, 0) (2018, 0) (2019, 0) (2020, 0) (2021, 0) (2013, 1) }; \end{axis} \end{tikzpicture} \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

15 Jul '22, 14:05

dzaic's gravatar image

dzaic
631175055

Warum wird die Jahreszahl bei pgfplots plötzlich als Float ausgegeben?

Bei der Erstellung der folgenden Abbildung wird plötzlich die Jahreszahl (Integer) als Float ausgegeben. \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usetikzlibrary{shapes,arrows, positioning} \begin{document} \begin{tikzpicture} \begin{axis}[ height=4cm, width=\textwidth, ybar, xmin = 1984, xmax = 2022, ymin = 0, ymax = 3, xtick={1985,...,2021}, x tick label style={rotate=90, anchor=east, /pgf/number format/1000 sep=}, xtick pos=left, ylabel={Number of failures}, ytick={0,...,3}, bar width = 5pt ] \addplot coordinates { (1985, 3) (1986, 0) (1987, 0) (1988, 0) (1989, 0) (1990, 0) (1991, 0) (1992, 0) (1993, 0) (1994, 0) (1995, 0) (1996, 0) (1997, 0) (1998, 0) (1999, 2) (2000, 0) (2001, 0) (2002, 0) (2003, 0) (2004, 0) (2005, 0) (2006, 0) (2007, 0) (2008, 0) (2009, 0) (2010, 0) (2011, 0) (2012, 0) (2013, 0) (2014, 0) (2015, 0) (2016, 0) (2017, 0) (2018, 0) (2019, 0) (2020, 0) (2021, 0) (2013, 1) }; \end{axis} \end{tikzpicture} \end{document}