Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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:

as csv-file (without headers):


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

share|improve this question

marked as duplicate by m0nhawk, Christian Hupfer, Guido, percusse tikz-pgf Aug 6 '14 at 10:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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. – sv0101 Aug 4 '14 at 15:08
@m0nhawk still willing to help me out? :) – sv0101 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

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
Thank's a lot! That worked! – sv0101 Aug 6 '14 at 9:17
@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. – sv0101 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? – sv0101 Aug 6 '14 at 10:12
@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.