[Tex/LaTex] Creating an empty bar chart, for students to fill in data

bar chart

What's the easiest way in Latex to create a simple, nice looking, empty bar chart — I'll set up the axes appropriately, but students will fill in the data.

To be specific, the bar chart will show how many ways there are to get each possible sum (from 2 to 12) when rolling a pair of dice. So for example, there are 6 ways to get a sum of 7, etc.

Edit: Here is my attempt. Please let me know if you see a better way to do this!

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

            \draw[dashed,gray] (0,0) grid (11,6);
            \draw (0,0) --(11,0);
            \draw (0,0) --(0,6);

            \node at (.5,-.5) {2};
            \node at (1.5,-.5) {3};
            \node at (2.5,-.5) {4};
            \node at (3.5,-.5) {5};
            \node at (4.5,-.5) {6};
            \node at (5.5,-.5) {7};
            \node at (6.5,-.5) {8};
            \node at (7.5,-.5) {9};
            \node at (8.5,-.5) {10};
            \node at (9.5,-.5) {11};
            \node at (10.5,-.5) {12};

            \node at (-.5,1) {1};
            \node at (-.5,2) {2};
            \node at (-.5,3) {3};
            \node at (-.5,4) {4};
            \node at (-.5,5) {5};
            \node at (-.5,6) {6};

            \foreach \y in {1,2,3,4,5,6}
                \draw (-2pt,\y) -- (2pt,\y);

\end{tikzpicture}

\end{document}

Best Answer

Here is how I would do it with pgfplots. The styling code is commented extensively to show you what each option does. Many many more customizations are possible; consult the manual for complete details.

I plotted two invisible bars ((2,0) and (12,6)) to properly set the extents.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\begin{document}
\begin{tikzpicture}
\begin{axis}[%
  ybar,                                  % a bar plot
  xtick align=inside,                    % x-tick marks inside the axis
  ytick align=center,                    % y-tick marks straddle the axis
  width=5in,                             % 5 in width of plot
  axis equal image,                      % unity aspect ratio
  enlarge y limits=false,                % do not add padding to y axis limits
  axis lines*=left,                      % draw axis lines left and bottom; no arrows
  grid=major, grid style={gray,dashed},  % major grid, gray and dashed
  xtick={2,...,12},                      % x ticks integers from 2 to 12
  ytick={1,...,6},                       % y ticks integers from 1 to 6
]
  \addplot[opacity=0] coordinates {(2,0) (12,6)}; % two bars are good enough to get the correct extents
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

One advantage of this approach is that you can store all of your customizations as a TikZ style. Then you can apply this style to other axis environments to automatically get consistent styling for graphs that may have different sizing or extents.