1

I'm trying to create a histogram from a CSV file of single values like this:

2,
3,
2,
5,
2,
etc...

I also have a copy of this file in a similar layout that has just single numbers next to their count value if needed. I've looked around and have been unable to get the plot correct with the following code:

\begin{tikzpicture}
    \begin{axis}
        \addplot[ybar col sep=comma]{code/burst.csv}    
    \end{axis}
\end{tikzpicture}

I need a histogram that shows how many occurrences of each number there is in the file. Most examples I've found looking around have been more complex than so I haven't been able to pick out the syntax I need and I found the pgfplots manual to be a bit too esoteric as I'm not very well versed on the maths side of things.

  • 1
    Welcome to TeX-SE! It is possible to transpose the data, if that's what you are asking. If you want to get a detailed answer, please provide us with a detailed question, which contains a compilable code that starts with \documentclass and ends with \end{document}. –  Mar 06 '19 at 19:54
  • of the cuff conjecture, since you are using a comma and declare comma separated you could try a dummy 0 on each line –  Mar 06 '19 at 19:55
  • 1
    https://tex.stackexchange.com/questions/153325/how-to-compute-an-histogram-plot-bars-binning-the-values-from-a-csv-using-tex – Fran Mar 07 '19 at 00:36

0 Answers0