Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7987

Re: without individual scaling?

From David Bevan <david.bevan@pb.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: without individual scaling?
Date 2012-01-19 10:10 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jf8q70$3ij$1@smc.vnet.net> (permalink)
References <201201162204.RAA15204@smc.vnet.net>,<201201170822.DAA23142@smc.vnet.net>

Show all headers | View raw


Here's another example of the problem:

isValidPolyCell[{x_, y_}] := x >= 1 || x >= 0 && y >= 0
newCells[{x_, y_}] :=
 Select[{{x + 1, y}, {x - 1, y}, {x, y + 1}, {x, y - 1}},
  isValidPolyCell]
growPoly[p_] :=
 Join[p, {#}] & /@
  Complement[DeleteDuplicates@Flatten[newCells /@ p, 1], p]
polys[1] = {{{0, 0}}};
polys[n_] :=
 polys[n] =
  DeleteDuplicates[Sort /@ Flatten[growPoly /@ polys[n - 1], 1]]
showPoly[p_] := Graphics[{LightBlue, EdgeForm[Black], Rectangle /@ p}]

GraphicsRow[showPoly /@ polys[4]]

-- the polyominoes are at three different scales.

David %^>

________________________________________
From: Scot T. Martin [smartin@seas.harvard.edu]
Sent: 17 January 2012 08:22
Subject: Re: without individual scaling?

My favorite commands for doing the kinds of things you want:

Grid[....] (instead of GraphicsRow, GraphicsGrid, which seem to do funny things for me)

Show[...] with Inset[...] as needed using Scaled[...] for coordinates.

When you make your Plots/Graphics, make good use of ImagePadding option (i.e., fixed to same value for everything) so that your axes all line up nicely.


________________________________________
From: David Bevan [david.bevan@pb.com]
Sent: Monday, January 16, 2012 17:04
Subject: Re: without individual scaling?

Hi!

Since asking this question I have discovered GraphicsRow[].

What I need is some way of doing GraphicsRow[objs] but without each graphics getting scaled individually.

Equivalently, I need is some way of doing Show[objs] but with the graphics in a row, not overlaid.

Clearly, Mathematica has the information to do this. Is there no way for a user to access this information?

Thanks.

David %^>

________________________________________
From: David Bevan [david.bevan@pb.com]
Sent: 10 January 2012 10:57
Subject: Graphics bounding box in source coordinates?

Is there some way of getting the bounding box of Graphics in the source coordinate system? For example, Show can be used to display an array of objects on top of each other:

showObj[z_]:=Graphics[{Circle[{z,z},z]}]
objs=showObj/@Range[5];
Show[objs]

But I want to display them side by side. The following can be used to offset each object by a fixed interval:

graphicsArray[g_,x_]:=Graphics[MapIndexed[Translate[#1,{x (First[#2]-1),0}]&,First/@g]]
graphicsArray[objs,5]

But I would like the gaps between each object to be of fixed size. So I want a version of graphicsArray which determines the value to pass to Translate by getting the bounding box info from each Graphic.

Rasterize[,"BoundingBox"] doesn't help because it returns the size in pixels after scaling:

Rasterize[#,"BoundingBox"]&/@objs
{{360,359,182},{360,359,182},{360,359,182},{360,359,182},{360,359,182}}

My real objects are more complex than these simple circles (and I want something reusable with different objects).

Thanks for your help (and apologies if I missed something obvious in the documentation).

David %^>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: without individual scaling? David Bevan <david.bevan@pb.com> - 2012-01-19 10:10 +0000

csiph-web