5

I have some data which I would like to visualize. This data are 3-tuples of integers:

(Threads,Sum,# of occurences)
(1,2,20)
(1,7,18)
(1,100,25)
(2,7,15)
(4,103,24)

I would like to visualize this in a 3D bar plot (I'm not sure, but it seems also to be called "Manhattan bar chart").

The given example could look like this:

enter image description here

How can I create such a bar plot with LaTeX (TikZ, pgfplot or another package)? Please note that the given example is simplified. I would like to show much more tuples, so simply drawing all those lines "by hand" is not a solution. I can give the tuples in any form, but the drawing part should not change if I add some data.

lockstep
  • 250,273
Martin Thoma
  • 18,799
  • 5
    The following answer might help: http://tex.stackexchange.com/a/53754/2552 – Jake Feb 03 '13 at 15:40
  • please let us know if Jake's link resolves the issue- if so, we'll close this as a duplicate :) – cmhughes Feb 03 '13 at 17:05
  • It is a great help, but I would also like to have only some coordinates (in my example 2, 7, 100, 101, 102, 103, 200) for y-axis. Is this possible? – Martin Thoma Feb 03 '13 at 19:08
  • And the solution that Jake linked is sub-optimal, as you have to repeat a lot. – Martin Thoma Feb 03 '13 at 19:26
  • @moose: The question I linked to includes a Python script that generates the drawing coordinates (you're not expected to generate those by hand, of course!). To plot only some columns, the script would need to be adapted slightly, but that shouldn't be too hard. Would you be happy with such an approach? – Jake Feb 03 '13 at 22:26
  • @Jake: I needed some time to improve the Python script. It is now able to create a bar plot automatically (see https://github.com/MartinThoma/LaTeX-examples/tree/master/tikz/3d-manhattan-bar-plot). You only need to add your data to the main part. Then you can call make and everything is fine :-) Should I change the Python script in the answer you've linked? – Martin Thoma Feb 07 '13 at 11:26
  • I guess this question can get closed as duplicate of 3-dimensional histogram in pgfplots, although the answer doesn't use pgfplots but TikZ. – Martin Thoma Feb 07 '13 at 11:29

0 Answers0