# Projecting image or contour plot on xy-plane of Histogram3D? [duplicate]

I've generated a simple 3D histogram, where the x-y coordinates corresponding to the "location" of an event defined on a simple 160x160 grid, and the z-axis height is simply the count of events that occur at each x-y location.

For this particular graph, I have an png image (think of it as a map) on which the 160x160 grid is defined. I'd like to use this image as the x-y floor of my Histogram3D. I'd also like to use a ListContourPlot as the x-y floor, in a companion image.

Any suggestions would be most welcome.

Thanks.

Mark

Basically you can use Show to combine your Histogram3D object with a Graphics3D object. I use a Polygon with a Texture on it to hold the image. To make the image more visible you can set the opacity level of the Histogram3D:

Show[Histogram3D[RandomReal[{0, 1}, {50, 2}],
ChartBaseStyle -> Opacity[0.4]],
Graphics3D[{Texture[ExampleData[{"TestImage", "Lena"}]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]]


The above code gives the following representation: The only thing you have to adjust for your particular case is to set the position of the polygon according to your data. Hope this helps, cheers.

Another variation using Texture:

data = RandomVariate[NormalDistribution[0, 1], {100, 2}];

{g, {binCounts}} =  Reap[Histogram3D[data, {-2, 2, 0.25},
Function[{xbins, ybins, counts}, Sow[counts]]]];

img1 = Image[MatrixPlot[First@binCounts, Frame -> False, Axes -> False,
DataReversed -> True,ImageSize -> 400]];

img2 = ExampleData@{"TestImage", "Peppers"};

hst3D = Histogram3D[data, {-2, 2, 0.25},  Function[{xbins, ybins, counts}, counts],
Boxed -> False, Axes -> False,(* Background -> Black,*)
ChartBaseStyle -> Opacity[.3], ChartStyle -> Green, 