Skip to main content
added 572 characters in body
Source Link
george2079
  • 39.3k
  • 1
  • 45
  • 115

Edit, based on the added info in the question:

 data1 = RandomVariate[BinormalDistribution[.75], 10]; distribution1 = SmoothKernelDistribution[data1]; data2 = RandomVariate[BinormalDistribution[.75], 10]; distribution2 = SmoothKernelDistribution[data2]; ContourPlot[ {PDF[distribution1, {x, y}] == 10^(-2), PDF[distribution2, {x, y}] == 10^(-2)}, {x, -3, 3}, {y, -3, 3}, ContourStyle -> {Red,Blue}, ContourShading -> None] 

enter image description here

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{ Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]], hl[[2, j, i]]}, {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1], Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{ Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]], hl[[2, j, i]]}, {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1], Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

Edit, based on the added info in the question:

 data1 = RandomVariate[BinormalDistribution[.75], 10]; distribution1 = SmoothKernelDistribution[data1]; data2 = RandomVariate[BinormalDistribution[.75], 10]; distribution2 = SmoothKernelDistribution[data2]; ContourPlot[ {PDF[distribution1, {x, y}] == 10^(-2), PDF[distribution2, {x, y}] == 10^(-2)}, {x, -3, 3}, {y, -3, 3}, ContourStyle -> {Red,Blue}, ContourShading -> None] 

enter image description here

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{ Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]], hl[[2, j, i]]}, {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1], Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

added 33 characters in body
Source Link
george2079
  • 39.3k
  • 1
  • 45
  • 115

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{ Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]],  hl[[2, j, i]]}, {i,  {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1],   Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]], hl[[2, j, i]]}, {i,  Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1], Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{ Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]],  hl[[2, j, i]]}, {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1],   Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..

Source Link
george2079
  • 39.3k
  • 1
  • 45
  • 115

something like this?

 r = RandomVariate[BinormalDistribution[.5], 100]; hg = Histogram3D[r] 

enter image description here

 hl = HistogramList[r]; Show[hg, Graphics3D[{Thick, Red, Map[Append[#, 5] & , First@Cases[Normal@First@ Cases[ListContourPlot[ Flatten[Table[{Mean@hl[[1, 1, j ;; j + 1]], Mean@hl[[1, 2, i ;; i + 1]], hl[[2, j, i]]}, {i, Length@hl[[1, 2]] - 1}, {j, Length@hl[[1, 1]] - 1}], 1], Contours -> {5}], _GraphicsComplex, Infinity], _Line, Infinity], {2}]}]] 

enter image description here

By the way, It would be cleaner to work with SmoothDensityHistogram, but I can't figure how to coax it to give a single contour line at a specified level..