I've created a bar chart from some data. There are 157 data lines, which also can been seen in the horizontal x-axis in the chart. It's looks not nice with that much data, is it possible that I can only show every 5 years instead of every year.
I've found this:
x post scale=2
but that only give data every two year. I would lik to see every year but only the axis should give for example every 5 years
Code: Select all
\documentclass[letterpaper]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[ ybar,
xlabel=Character,
ylabel=Number of Locks,
xtick=data,
xticklabels from table={my.dat}{Character},
bar width=0.5pt,
width=1*\textwidth,
x tick label style={font=\tiny,align=right,rotate=90},
x post scale=2,
enlarge x limits=0.015,
enlarge y limits=0.01,
]
\addplot table
[ x=X-Position,
y=Probability
]
{my.dat};
\end{axis}
\end{tikzpicture}
\end{document}
Code: Select all
Character X-Position Probability
1856 1 1
1857 2 0
1858 3 0
1859 4 0
1860 5 0
1861 6 0
1862 7 0
1863 8 2
1864 9 0
1865 10 0
1866 11 0
1867 12 0
1868 13 0
1869 14 0
1870 15 3
1871 16 0
1872 17 2
1873 18 0
1874 19 0
1875 20 0
1876 21 0
1877 22 0
1878 23 0
1879 24 0
1880 25 0
1881 26 0
1882 27 0
1883 28 0
1884 29 1
1885 30 1
1886 31 1
1887 32 0
1888 33 0
1889 34 1
1890 35 0
1891 36 1
1892 37 0
1893 38 0
1894 39 0
1895 40 0
1896 41 1
1897 42 0
1898 43 1
1899 44 0
1900 45 0
1901 46 0
1902 47 0
1903 48 0
1904 49 0
1905 50 0
1906 51 1
1907 52 0
1908 53 0
1909 54 0
1910 55 1
1911 56 0
1912 57 0
1913 58 0
1914 59 0
1915 60 0
1916 61 2
1917 62 0
1918 63 0
1919 64 0
1920 65 2
1921 66 1
1922 67 0
1923 68 1
1924 69 0
1925 70 1
1926 71 3
1927 72 2
1928 73 1
1929 74 0
1930 75 4
1931 76 4
1932 77 3
1933 78 4
1934 79 1
1935 80 1
1936 81 1
1937 82 8
1938 83 1
1939 84 0
1940 85 0
1941 86 0
1942 87 1
1943 88 0
1944 89 0
1945 90 0
1946 91 0
1947 92 0
1948 93 0
1949 94 0
1950 95 0
1951 96 0
1952 97 1
1953 98 2
1954 99 0
1955 100 1
1956 101 0
1957 102 0
1958 103 4
1959 104 1
1960 105 2
1961 106 1
1962 107 4
1963 108 0
1964 109 3
1965 110 0
1966 111 1
1967 112 5
1968 113 4
1969 114 4
1970 115 0
1971 116 0
1972 117 2
1973 118 1
1974 119 3
1975 120 1
1976 121 0
1977 122 1
1978 123 0
1979 124 0
1980 125 0
1981 126 0
1982 127 1
1983 128 2
1984 129 1
1985 130 0
1986 131 0
1987 132 5
1988 133 0
1989 134 1
1990 135 1
1991 136 1
1992 137 0
1993 138 0
1994 139 0
1995 140 0
1996 141 0
1997 142 1
1998 143 0
1999 144 0
2000 145 2
2001 146 0
2002 147 0
2003 148 2
2004 149 0
2005 150 0
2006 151 0
2007 152 2
2008 153 0
2009 154 3
2010 155 0
2011 156 0