# Show additional box border in 3D plot

Clash Royale CLAN TAG#URR8PPP

How to best draw an additional box boder at {x, y, 0} as indicated by the red arrow below? PlotRange is Automatic (do not assume it is {{0, 100}, {0, 100}, {-50, 50}} always).

points = RandomReal[100, {100, 3}];
points[[All, 3]] = points[[All, 3]] - 50;
ListPointPlot3D[points, BoxRatios -> 1]


The only idea I have is extracting PlotRange with AbsoluteOptions and drawing the box border manually. That may be too difficult for me. I use Mathematica 9.

How to best draw an additional box boder at {x, y, 0} as indicated by the red arrow below? PlotRange is Automatic (do not assume it is {{0, 100}, {0, 100}, {-50, 50}} always).

points = RandomReal[100, {100, 3}];
points[[All, 3]] = points[[All, 3]] - 50;
ListPointPlot3D[points, BoxRatios -> 1]


The only idea I have is extracting PlotRange with AbsoluteOptions and drawing the box border manually. That may be too difficult for me. I use Mathematica 9.

How to best draw an additional box boder at {x, y, 0} as indicated by the red arrow below? PlotRange is Automatic (do not assume it is {{0, 100}, {0, 100}, {-50, 50}} always).

points = RandomReal[100, {100, 3}];
points[[All, 3]] = points[[All, 3]] - 50;
ListPointPlot3D[points, BoxRatios -> 1]


The only idea I have is extracting PlotRange with AbsoluteOptions and drawing the box border manually. That may be too difficult for me. I use Mathematica 9.

How to best draw an additional box boder at {x, y, 0} as indicated by the red arrow below? PlotRange is Automatic (do not assume it is {{0, 100}, {0, 100}, {-50, 50}} always).

points = RandomReal[100, {100, 3}];
points[[All, 3]] = points[[All, 3]] - 50;
ListPointPlot3D[points, BoxRatios -> 1]


The only idea I have is extracting PlotRange with AbsoluteOptions and drawing the box border manually. That may be too difficult for me. I use Mathematica 9.

plotting graphics3d boxes listpointplot3d

Frank

33118

33118

active

oldest

You can use InfinitePlane without having to get the PlotRange of input plot:

Show[ListPointPlot3D[points, BoxRatios -> 1],
Graphics3D[{Opacity[0], EdgeForm[{Blue, Thick}],
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}}]}]]


Update: An alternative that also works in version 9 is to use FaceGrids:

facegrids = {#, {{}, {0}}} & /@ Join[#, -#] &@Most[IdentityMatrix[3]];
ListPointPlot3D[points, BoxRatios -> 1, FaceGrids -> facegrids,
FaceGridsStyle -> Directive[Thick, Blue]]


Update 2: You can also use PlotRange to extract the plot range of a plot object and use it with Cuboid:

lpp = ListPointPlot3D[points, BoxRatios -> 1];
rectangle = Transpose[Append[PlotRange[lpp][[;; 2]], {0, 0}]];
Show[lpp, Graphics3D[{Opacity[0], EdgeForm[{Thick, Blue}], Cuboid @@ rectangle}]]


• Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

• @Frank, please see the update.
– kglr
Nov 28 at 20:01

• That’s truly fantastic.
– Frank
Nov 28 at 20:15

You can use the useful-but-undocumented function Chartingget3DPlotRange to find the plot range, and use that to make your box:

points = RandomReal[{-50, 50}, {100, 3}];
plot = ListPointPlot3D[points, BoxRatios -> 1];
{x, y, z} = Chartingget3DPlotRange @ plot;
Show[plot,
Graphics3D[
{
EdgeForm @ Blue,
FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
Cuboid @@ Thread[{x, y, {0, 0}}]
}
]
]


• Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

active

oldest

active

oldest

active

oldest

active

oldest

You can use InfinitePlane without having to get the PlotRange of input plot:

Show[ListPointPlot3D[points, BoxRatios -> 1],
Graphics3D[{Opacity[0], EdgeForm[{Blue, Thick}],
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}}]}]]


Update: An alternative that also works in version 9 is to use FaceGrids:

facegrids = {#, {{}, {0}}} & /@ Join[#, -#] &@Most[IdentityMatrix[3]];
ListPointPlot3D[points, BoxRatios -> 1, FaceGrids -> facegrids,
FaceGridsStyle -> Directive[Thick, Blue]]


Update 2: You can also use PlotRange to extract the plot range of a plot object and use it with Cuboid:

lpp = ListPointPlot3D[points, BoxRatios -> 1];
rectangle = Transpose[Append[PlotRange[lpp][[;; 2]], {0, 0}]];
Show[lpp, Graphics3D[{Opacity[0], EdgeForm[{Thick, Blue}], Cuboid @@ rectangle}]]


• Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

• @Frank, please see the update.
– kglr
Nov 28 at 20:01

• That’s truly fantastic.
– Frank
Nov 28 at 20:15

You can use InfinitePlane without having to get the PlotRange of input plot:

Show[ListPointPlot3D[points, BoxRatios -> 1],
Graphics3D[{Opacity[0], EdgeForm[{Blue, Thick}],
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}}]}]]


Update: An alternative that also works in version 9 is to use FaceGrids:

facegrids = {#, {{}, {0}}} & /@ Join[#, -#] &@Most[IdentityMatrix[3]];
ListPointPlot3D[points, BoxRatios -> 1, FaceGrids -> facegrids,
FaceGridsStyle -> Directive[Thick, Blue]]


Update 2: You can also use PlotRange to extract the plot range of a plot object and use it with Cuboid:

lpp = ListPointPlot3D[points, BoxRatios -> 1];
rectangle = Transpose[Append[PlotRange[lpp][[;; 2]], {0, 0}]];
Show[lpp, Graphics3D[{Opacity[0], EdgeForm[{Thick, Blue}], Cuboid @@ rectangle}]]


• Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

• @Frank, please see the update.
– kglr
Nov 28 at 20:01

• That’s truly fantastic.
– Frank
Nov 28 at 20:15

You can use InfinitePlane without having to get the PlotRange of input plot:

Show[ListPointPlot3D[points, BoxRatios -> 1],
Graphics3D[{Opacity[0], EdgeForm[{Blue, Thick}],
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}}]}]]


Update: An alternative that also works in version 9 is to use FaceGrids:

facegrids = {#, {{}, {0}}} & /@ Join[#, -#] &@Most[IdentityMatrix[3]];
ListPointPlot3D[points, BoxRatios -> 1, FaceGrids -> facegrids,
FaceGridsStyle -> Directive[Thick, Blue]]


Update 2: You can also use PlotRange to extract the plot range of a plot object and use it with Cuboid:

lpp = ListPointPlot3D[points, BoxRatios -> 1];
rectangle = Transpose[Append[PlotRange[lpp][[;; 2]], {0, 0}]];
Show[lpp, Graphics3D[{Opacity[0], EdgeForm[{Thick, Blue}], Cuboid @@ rectangle}]]


You can use InfinitePlane without having to get the PlotRange of input plot:

Show[ListPointPlot3D[points, BoxRatios -> 1],
Graphics3D[{Opacity[0], EdgeForm[{Blue, Thick}],
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}}]}]]


Update: An alternative that also works in version 9 is to use FaceGrids:

facegrids = {#, {{}, {0}}} & /@ Join[#, -#] &@Most[IdentityMatrix[3]];
ListPointPlot3D[points, BoxRatios -> 1, FaceGrids -> facegrids,
FaceGridsStyle -> Directive[Thick, Blue]]


Update 2: You can also use PlotRange to extract the plot range of a plot object and use it with Cuboid:

lpp = ListPointPlot3D[points, BoxRatios -> 1];
rectangle = Transpose[Append[PlotRange[lpp][[;; 2]], {0, 0}]];
Show[lpp, Graphics3D[{Opacity[0], EdgeForm[{Thick, Blue}], Cuboid @@ rectangle}]]


edited Nov 28 at 20:16

kglr

175k9197402

175k9197402

• Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

• @Frank, please see the update.
– kglr
Nov 28 at 20:01

• That’s truly fantastic.
– Frank
Nov 28 at 20:15

• Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

• @Frank, please see the update.
– kglr
Nov 28 at 20:01

• That’s truly fantastic.
– Frank
Nov 28 at 20:15

Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

Something like this I was hoping for, thanks. Unfortunately InfinitePlane was only introduced in MMA 10.
– Frank
Nov 28 at 19:42

– kglr
Nov 28 at 20:01

– kglr
Nov 28 at 20:01

That’s truly fantastic.
– Frank
Nov 28 at 20:15

That’s truly fantastic.
– Frank
Nov 28 at 20:15

You can use the useful-but-undocumented function Chartingget3DPlotRange to find the plot range, and use that to make your box:

points = RandomReal[{-50, 50}, {100, 3}];
plot = ListPointPlot3D[points, BoxRatios -> 1];
{x, y, z} = Chartingget3DPlotRange @ plot;
Show[plot,
Graphics3D[
{
EdgeForm @ Blue,
FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
Cuboid @@ Thread[{x, y, {0, 0}}]
}
]
]


• Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

You can use the useful-but-undocumented function Chartingget3DPlotRange to find the plot range, and use that to make your box:

points = RandomReal[{-50, 50}, {100, 3}];
plot = ListPointPlot3D[points, BoxRatios -> 1];
{x, y, z} = Chartingget3DPlotRange @ plot;
Show[plot,
Graphics3D[
{
EdgeForm @ Blue,
FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
Cuboid @@ Thread[{x, y, {0, 0}}]
}
]
]


• Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

You can use the useful-but-undocumented function Chartingget3DPlotRange to find the plot range, and use that to make your box:

points = RandomReal[{-50, 50}, {100, 3}];
plot = ListPointPlot3D[points, BoxRatios -> 1];
{x, y, z} = Chartingget3DPlotRange @ plot;
Show[plot,
Graphics3D[
{
EdgeForm @ Blue,
FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
Cuboid @@ Thread[{x, y, {0, 0}}]
}
]
]


You can use the useful-but-undocumented function Chartingget3DPlotRange to find the plot range, and use that to make your box:

points = RandomReal[{-50, 50}, {100, 3}];
plot = ListPointPlot3D[points, BoxRatios -> 1];
{x, y, z} = Chartingget3DPlotRange @ plot;
Show[plot,
Graphics3D[
{
EdgeForm @ Blue,
FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
Cuboid @@ Thread[{x, y, {0, 0}}]
}
]
]


Jason B.

47.5k387185

47.5k387185

• Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

• Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

Thanks! I ran into trouble when using this together with PlotLegends -> Placed.
– Frank
Nov 28 at 20:16

Thanks for contributing an answer to Mathematica Stack Exchange!

But avoid

• Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

Please pay close attention to the following guidance:

But avoid

• Making statements based on opinion; back them up with references or personal experience.

draft saved

function () {
}
);

### Post as a guest

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown

Required, but never shown