0
$\begingroup$

my code is something like

a = {{Cuboid[]}, {Cuboid[], Cuboid[{1, 0, 0}]},
     {Cuboid[], Cuboid[{1, 0, 0}], Cuboid[{0, 1, 0}]}};
Graphics3D/@ a

Every single entry of the table (of graphics) is correct but, I would like to set the same scale to all, i.e. the absolute size of the boxes inside the graphs should be the same. How can I do?

$\endgroup$
  • $\begingroup$ Have you seen documentation for Graphics3D? There is a list of available options in Details&Options section $\endgroup$ – Kuba Sep 14 '16 at 8:58
  • $\begingroup$ Yes I have but I couldn't find the solution $\endgroup$ – MaPo Sep 14 '16 at 9:00
  • $\begingroup$ If you write my code on Mathematica you will see that a table of three 3D Graphics: the first with one box the second one with two boxes and the third one with three. All the graphs will have te same absolute size meaning that the only box of the first graphics will occupy approximately the same space of the two boxes of the second or the three boxes of the third one. I would like to have all the boxes of the same size, so that the first graph should have an absolute dimension smaller than the second and the third. The absolute I wrote in the post was referred to the dimension of the boxes $\endgroup$ – MaPo Sep 14 '16 at 9:08
  • $\begingroup$ Graphics3D[#, PlotRange -> 2] & /@ a? $\endgroup$ – Kuba Sep 14 '16 at 9:10
  • 1
    $\begingroup$ They are centered in a table, but they are not centered in the bounding box. Moreover it was not part of the question so please focus on stating precisely what do you need. Or you can assemble an image to show. $\endgroup$ – Kuba Sep 14 '16 at 9:26
4
$\begingroup$

As Kuba said, you might first want to ensure that the PlotRange is the same so that the plots are at the same scale when at the same absolute size. Note that you're looking at the plots in List form: List[plot1,plot2,plot3]. Mathematica will do you a favour by displaying these graphics so you can easily tell what's in the List, but if you intend on actually displaying these graphics then you should really use something like Row or GraphicsRow. I prefer Row because it actually pays attention to options you use like ImageSize.

So here's an example of displaying the three plots using Row:

a = {{Cuboid[]}, {Cuboid[], Cuboid[{1, 0, 0}]}, {Cuboid[], 
    Cuboid[{1, 0, 0}], Cuboid[{0, 1, 0}]}};
Row[Graphics3D[#, PlotRange -> {{0, 2}, {0, 2}, {0, 2}}, 
    ImageSize -> 400] & /@ a]

Output:

enter image description here

$\endgroup$
  • $\begingroup$ I seem to be finding uncommented downvotes these days. Often folks here are interested in helping each other and improving the site. A comment on how to improve would be helpful to the author and to the site. The DV tooltip says "This answer is not useful," but that can be a pretty low threshold. Most answers are not useful to me. Upvote vs. not upvote is enough of a distinction for me, for innocuous answers. Harmful answers deserve a DV & a comment, though, imo. I don't see a problem here, although I don't know what the question is about. $\endgroup$ – Michael E2 Sep 16 '16 at 0:07
  • $\begingroup$ @MichaelE2 - Just deleted my comment because I found that out myself just now. Thanks anyway. $\endgroup$ – Myridium Sep 16 '16 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.