Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Aligning my images in Grid causes one of them to become smaller, despite specifying each of their sizes with ImageSize:

dat = Table[{x, y, RandomReal[]*x*y}, {x, 1, 50}, {y, 1, 50}];
img = ListContourPlot[Flatten[dat, 1], ImageSize -> {300, 300}];
oldspotlight = 
  Graphics[{}, Background -> Black, PlotRange -> {{1, 50}, {1, 50}}, 
   ImageSize -> 300];
a=Show[img, 
 Graphics[{Circle[{90, 60}, 10]}, PlotRange -> {{1, 50}, {1, 50}}, 
  ImageSize -> {300, 300}]]
b=ImageMultiply[img, 
 ImageAdd[oldspotlight, 
  Graphics[{ColorData["GrayTones"][10/20], Disk[{90, 60}, 10]}, 
   Background -> Black, PlotRange -> {{1, 50}, {1, 50}}, 
   ImageSize -> {300, 300}]]]
Grid[{{a,b}}]

Output:

enter image description here

enter image description here

enter image description here

Please note that I don't want to use GraphicsGrid. (The reason is because it doesn't cooperate with Dynamic, which is an unrelated question.)

share|improve this question
    
If you could find a simple that example that still has this problem, it would be easier to help. Right now there is a lot of code, but most of it is unrelated to your problem. –  Pickett Dec 14 '13 at 17:11
    
Anon: I made the code a little simpler –  user8454 Dec 14 '13 at 17:16
    
Curious. From the documentation: Grid will not change the size of graphics or other objects that have explicit ImageSize settings. –  David Carraher Dec 14 '13 at 17:28
    
Does Row[{img, oldspotlight}] do what you want? It does not resize. –  bill s Dec 14 '13 at 17:44
    
Sorry @bill s, for the non-minimum working example, but I would want Row[{a,b}], which worsens the problem –  user8454 Dec 14 '13 at 17:46
show 4 more comments

2 Answers

up vote 2 down vote accepted

One way to do it, which would be a minimal change to your current code, is just wrap image b in Show as you did with image a and give the ImageSize option to this second Show.

dat = Table[{x, y, RandomReal[]*x*y}, {x, 1, 50}, {y, 1, 50}];
img = ListContourPlot[Flatten[dat, 1], ImageSize -> {300, 300}];
oldspotlight = 
  Graphics[{}, Background -> Black, PlotRange -> {{1, 50}, {1, 50}}, 
   ImageSize -> 300];
a = Show[img, 
  Graphics[{Circle[{90, 60}, 10]}, PlotRange -> {{1, 50}, {1, 50}}, 
   ImageSize -> {300, 300}]];
b = Show[ImageMultiply[img, 
   ImageAdd[oldspotlight, 
    Graphics[{ColorData["GrayTones"][10/20], Disk[{90, 60}, 10]}, 
     Background -> White, PlotRange -> {{1, 50}, {1, 50}}]]], 
  ImageSize -> {300, 300}];
Grid[{{a, b}}]

enter image description here

share|improve this answer
add comment

How about using Row:

Row[{img, "  ", oldspotlight}]

or

Row[{a, "  ", Image[b, ImageSize -> 300]}]

both of which give:

enter image description here

(I added the " " to make some space between them).

share|improve this answer
    
I wish I could also accept this as the answer! –  user8454 Dec 14 '13 at 18:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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