I would like to draw a punchcard in Latex as shown below. But i just can't find any information how to do this (not even in the manual of tikz). The only thing i can find is information about bubble charts (with x and y axis) I would like to get the data from a csv-file, for example with the command:

\addplot table {table.csv}

Link to my data as .ods-file: https://www.dropbox.com/s/3qgdh9klo2xpxcz/punchcard.ods

as csv-file (without headers): https://www.dropbox.com/s/10ql1wzf8ired9p/punchcard-csv.csv


Source of that image is the article of Maalej and Robillard: Patterns of knowledge in API reference documentation

  • First, do you have this data? Second, this is named a "punchcard" and I once post helpful answer for you. I can adjust it for you, if you share the data. – m0nhawk Aug 4 '14 at 14:30
  • Just for curiousity: what is the meaning of the different sizes and colors? – Uwe Ziegenhagen Aug 4 '14 at 15:05
  • the different sizes are for different absolute values (like 1 is small and 100 is big). In this example black points are for positive values and gray are for negative ones. – svenwildermann Aug 4 '14 at 15:08
  • @m0nhawk still willing to help me out? :) – svenwildermann Aug 4 '14 at 22:11
  • Where is the command \addplot defined? Also, rather than giving a link to a dropbox folder it would be more helpful if you showed us the first few lines of the data file. Also, please consider adding a minimal working example. – Andrew Aug 5 '14 at 5:31

As a workaround you can use my old code with a converted data:




                point meta=explicit,
                scatter/@pre marker code/.code={
                        mark size=\pgfmathresult}
                scatter/@post marker code/.code={
                symbolic x coords={Type2,Type3,Type4,Type5,Type6,Type7,Type8,Type9,Type10,Type11,Type12},
                symbolic y coords={Type12,Type11,Type10,Type9,Type8,Type7,Type6,Type5,Type4,Type3,Type2,Type1}]
            \addplot[only marks,scatter]
                table[x index=0, y index=1, meta index=2] {punchcard.csv};

enter image description here

  • @sv0101 But you need to completely rework your data. – m0nhawk Aug 6 '14 at 9:19
  • I saw. But that's a small problem to solve. – svenwildermann Aug 6 '14 at 9:25
  • Y-Axis end now with Type10 (should be Type11) and x-Axis starts with Type3 (should be Type2). Is that also caused by the data or by settings? – svenwildermann Aug 6 '14 at 10:12
  • By the data. I just remove the Type-Type with zero. – m0nhawk Aug 6 '14 at 10:13
  • 1
    @sv0101 Oh, also I forget the Type11 Type12 12. Sorry for that, just add it and update. – m0nhawk Aug 6 '14 at 10:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.