Show additional box border in 3D plot











up vote
3
down vote

favorite












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).



enter image description here



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.










share|improve this question


























    up vote
    3
    down vote

    favorite












    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).



    enter image description here



    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.










    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      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).



      enter image description here



      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.










      share|improve this question













      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).



      enter image description here



      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 28 at 17:11









      Frank

      33118




      33118






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          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}}]}]]


          enter image description here



          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]]


          enter image description here



          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}]]


          enter image description here






          share|improve this answer























          • 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




















          up vote
          2
          down vote













          You can use the useful-but-undocumented function Charting`get3DPlotRange 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} = Charting`get3DPlotRange @ plot;
          Show[plot,
          Graphics3D[
          {
          EdgeForm @ Blue,
          FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
          Cuboid @@ Thread[{x, y, {0, 0}}]
          }
          ]
          ]


          enter image description here






          share|improve this answer





















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











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "387"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186889%2fshow-additional-box-border-in-3d-plot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          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}}]}]]


          enter image description here



          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]]


          enter image description here



          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}]]


          enter image description here






          share|improve this answer























          • 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

















          up vote
          2
          down vote



          accepted










          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}}]}]]


          enter image description here



          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]]


          enter image description here



          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}]]


          enter image description here






          share|improve this answer























          • 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















          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          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}}]}]]


          enter image description here



          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]]


          enter image description here



          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}]]


          enter image description here






          share|improve this answer














          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}}]}]]


          enter image description here



          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]]


          enter image description here



          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}]]


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 28 at 20:16

























          answered Nov 28 at 19:33









          kglr

          174k9196402




          174k9196402












          • 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












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




          @Frank, please see the update.
          – 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












          up vote
          2
          down vote













          You can use the useful-but-undocumented function Charting`get3DPlotRange 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} = Charting`get3DPlotRange @ plot;
          Show[plot,
          Graphics3D[
          {
          EdgeForm @ Blue,
          FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
          Cuboid @@ Thread[{x, y, {0, 0}}]
          }
          ]
          ]


          enter image description here






          share|improve this answer





















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















          up vote
          2
          down vote













          You can use the useful-but-undocumented function Charting`get3DPlotRange 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} = Charting`get3DPlotRange @ plot;
          Show[plot,
          Graphics3D[
          {
          EdgeForm @ Blue,
          FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
          Cuboid @@ Thread[{x, y, {0, 0}}]
          }
          ]
          ]


          enter image description here






          share|improve this answer





















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













          up vote
          2
          down vote










          up vote
          2
          down vote









          You can use the useful-but-undocumented function Charting`get3DPlotRange 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} = Charting`get3DPlotRange @ plot;
          Show[plot,
          Graphics3D[
          {
          EdgeForm @ Blue,
          FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
          Cuboid @@ Thread[{x, y, {0, 0}}]
          }
          ]
          ]


          enter image description here






          share|improve this answer












          You can use the useful-but-undocumented function Charting`get3DPlotRange 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} = Charting`get3DPlotRange @ plot;
          Show[plot,
          Graphics3D[
          {
          EdgeForm @ Blue,
          FaceForm @ Opacity @ 0.05, (* set to 0 for transparent *)
          Cuboid @@ Thread[{x, y, {0, 0}}]
          }
          ]
          ]


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 at 19:02









          Jason B.

          47.3k387185




          47.3k387185












          • 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


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

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


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

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


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186889%2fshow-additional-box-border-in-3d-plot%23new-answer', 'question_page');
          }
          );

          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







          Popular posts from this blog

          AnyDesk - Fatal Program Failure

          How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

          QoS: MAC-Priority for clients behind a repeater