5 deleted 31 characters in body
source | link

DensityHistogram with sub-option "DistributionAxes" -> "Lines"

"DistributionAxes" -> "Lines"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing (to remove arrows and to change orientation), the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

DensityHistogram with sub-option "DistributionAxes" -> "Lines"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing (to remove arrows and to change orientation), the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

"DistributionAxes" -> "Lines"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing (to remove arrows and to change orientation), the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

4 added 41 characters in body
source | link
SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram with sub-option "DistributionAxes"

DensityHistogram with sub-option "DistributionAxes" -> "Lines"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing (to remove arrows and to change orientation), the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram with sub-option "DistributionAxes"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing, the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

DensityHistogram with sub-option "DistributionAxes" -> "Lines"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing (to remove arrows and to change orientation), the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

3 deleted 41 characters in body
source | link
SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram with sub-option "DistributionAxes"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Statistics`DataDistributionUtilities`UnivariateDataRugUnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing, the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram with sub-option "DistributionAxes"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Statistics`DataDistributionUtilities`UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing, the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

SeedRandom[1]
dt = RandomReal[1, {50, 2}];

DensityHistogram with sub-option "DistributionAxes"

You can use DensityHistogram with suboption "DistributionAxes" -> "Lines" and ListPlot of the data as Epilog:

DensityHistogram[dt, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

Alternatively, with sufficiently many equal-sized bins or sufficiently small bin widths, we can use ChartElementFunction -> "Point" in DensityHistogram to get a ListPlot of data without using Epilog:

DensityHistogram[dt, {100, 100}, 
 Method -> {"DistributionAxes" -> "Lines"}, ColorFunction -> (Red &), 
 ChartBaseStyle -> PointSize[Large], ChartElementFunction -> "Point"]

enter image description here

Another example:

dist1 = BinormalDistribution[{1, 1}, {1, 1}, 1/2];
dist2 = BinormalDistribution[{5, 5}, {1, 1}, -1/2]; dt2 = 
 RandomVariate[MixtureDistribution[{3, 2}, {dist1, dist2}], 300];
DensityHistogram[dt2, Method -> {"DistributionAxes" -> "Lines"}, 
 BaseStyle -> FaceForm[], 
 Epilog -> ListPlot[dt2, PlotStyle -> {Red, PointSize[Large]}][[1]]]

enter image description here

UnivariateDataRug

Statistics`DataDistributionUtilities`UnivariateDataRug[dt[[All, 1]]]

enter image description here

With some processing, the output of Statistics`DataDistributionUtilities`UnivariateDataRug can be used to construct data rugs for the vertical and horizontal axes.

ClearAll[rugF]
rugF[dir : ("horizontal" | "vertical") : "horizontal"] := 
  Module[{rule = If[dir === "horizontal", 
       Thread[{{x_, 0}, {x_, 1}} :> {{x, -.025}, {x, -.075}}], 
       Thread[{{x_, 0}, {x_, 1}} :> {{-.025, x}, {-.075, x}}]]}, 
    Statistics`DataDistributionUtilities`UnivariateDataRug[#] /. 
      Arrow[x_] :> {CapForm["Butt"], Line[x]} /. rule ] &;

Show[ListPlot[dt, PlotStyle -> PointSize[Large]], 
 rugF["vertical"][dt[[All, 2]]], rugF[][dt[[All, 1]]], 
 AspectRatio -> 1, Frame -> True, AxesOrigin -> {0, 0}, 
 PlotRangePadding -> {{.1, Scaled[.02]}, {.1, Scaled[.02]}}]

enter image description here

2 added 967 characters in body
source | link
1
source | link