Here is my problem. I have data in a statistic table with value / absolute frequency like this:

     1      1   
     2      2
     3      6
     4      10
     5      6
     6      2
     7      1
     8      0

Which allows me to draw column diagrams

\addplot[ybar] table[row sep=newline,y index=1] {\datatable};

Boxplot, however, requires uni-dimensional data (or preformatted, but I don't want to calculate the quartiles myself).

Hence my question: how can I use PGFPlots (PGFPlotsTable) to transform my statistical table with absolute frequency in a table with all the values in a uni-dimensional column required by boxplot.


foreach row in \datatable
    if \thisrowno(1)>0
        for i from 1 to \thisrowno(1)
            append \thisrow(0) to \newtable

I would really appreciate any help that would allow me to create column diagrams and boxplots by using a unique dataset.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.