# Plotting a Set of Three Points with Histogram3D

I would like to know whether I can use Histogram3D to plot a set of points with three given values. I want to plot the values {0, 0, 0.01}, {0, 1, 0.1}, {1, 0, 0.02}, {1, 1, 0.1} using Histogram3D. I tried the following command Histogram3D[{{0, 0, 0.01}, {0, 1, 0.1}, {1, 0, 0.02}, {1, 1, 0.1}}] but I wasn't successful! I also tried importing these values from an CSV file but also didn't work. Is there a way I can simply plot three values?

• Does this answer your question? How can I imitate the style of a certain 3D bar chart? – yarchik Jul 5 '20 at 11:34
• Try Histogram3D[RandomChoice[{0.01, 0.02, 0.1, 0.1} -> {{0,0}, {1,0}, {0,1},{1,1}}, 1000]] – yarchik Jul 5 '20 at 11:57
• Actually, I don’t want to create random numbers. I have the x,y,z values. We have 100 elements. The x and y are integers that have the following values 0,1,2,3,4,5,6,7,8,9. The z values are real numbers that range between 0.0 and 1.0. We can think of it as a matrix for each xy element we have a z value. But I want to plot them using Histogram3D. – Naps Jul 5 '20 at 14:24

A data set of 100 triples:

xy = Tuples[Range[0, 9], 2];
SeedRandom
z = RandomReal[1, 100];
xyz = Join[xy, List /@ z, 2];


Construct a WeightedData object from the list xyz using the first two columns as values and the last column as weights:

wd = WeightedData[xyz[[All, ;; 2]], xyz[[All, -1]]];


Use wd with Histogram3D:

Histogram3D[wd, ColorFunction -> "Rainbow"] Add the option ChartElementFunction -> "Cylinder" to get I'm guessing you are looking for something like this:

data = {{0, 0, 0.01}, {0, 1, 0.1}, {1, 0, 0.02}, {1, 1, 0.1}};
bars =
With[{r = .25},
Tooltip[Cylinder[{{#1, #2, 0}, {#1, #2, #3}}, r], {#1, #2, #3}] & @@@ data];
Graphics3D[bars, Axes -> True, BoxRatios -> {1, 1, 1}] 