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.

Is there a way to find the numeric equivalents of Tiny, Small, Medium, and Large for for ImageSize? In other words, what are the integers t, s, m, and l such that, for Graphics objects, the directives

ImageSize -> t
ImageSize -> s
ImageSize -> m
ImageSize -> l

are equivalent, respectively, to the directives

ImageSize -> Tiny
ImageSize -> Small
ImageSize -> Medium
ImageSize -> Large

?

share|improve this question
    
I think they produce the same result for all graphics but I'm not sure, but if that's the case: imgs = Graphics[Rectangle[{1, 1}], ImageSize -> #] & /@ {Tiny, Small, Medium, Large} and then ImageDimensions /@ imgs –  Pickett Sep 5 '13 at 17:32
2  
Depends on a case: Slider[.5, ImageSize -> Tiny] // Rasterize // ImageDimensions –  Vitaliy Kaurov Sep 5 '13 at 17:37
2  
Good point @Vitaliy, I assumed we're talking about Graphics. kjo, can you update your question and specify whether you're talking only about graphics or all situations? –  Szabolcs Sep 5 '13 at 17:41
    
@Szabolcs: done (yes, I was referring to Graphics only) –  kjo Sep 5 '13 at 18:06

1 Answer 1

up vote 12 down vote accepted

You can obtain the sizes like this:

In[1]:= Rasterize[Graphics[{}, ImageSize -> #], "RasterSize"] & /@ {Tiny, Small, Medium, Large}

Out[1]= {{100, 100}, {180, 180}, {360, 359}, {576, 575}}

It is the horizontal size that is relevant. The vertical size will depend on the aspect ratio. Thus ImageSize -> Medium corresponds to ImageSize -> 360.

A warning: In some cases Tiny, Small, etc. do not directly correspond to numerical values, and their effect depends on the context. I do not know if this is the case for ImageSize or not (I could imagine it might depend on the screen DPI setting, but then it might not.) I'm just warning you. (An example where this happens is Arrowheads, where using numerical values causes the arrow to scale with the graphic, while using e.g. Large makes the arrow size independent of the image size.)


Edit by István:

Below is a comprehensive list of possible ImageSize specifications for various objects, with default settings:

spec = {Tiny, Small, Medium, Large, All, None, Full, 
        Automatic, {Large, Automatic}, {{Tiny}, {Medium}},
        100, {100, 100}, Scaled@.6};

Panel@TableForm[{
   Rasterize[Graphics[{}, ImageSize -> #], "RasterSize"] & /@ spec,
   Rasterize[Graphics3D[{}, ImageSize -> #], "RasterSize"] & /@ spec,
   Rasterize[Plot[x, {x, 0, 1}, ImageSize -> #], "RasterSize"] & /@ spec,
   Rasterize[Slider[x, {0, 1}, ImageSize -> #], "RasterSize"] & /@ spec,
   Rasterize[Quiet@Pane["x", ImageSize -> #], "RasterSize"] & /@ spec
   } // Transpose, 
 TableHeadings -> {spec, {Graphics, Graphics3D, Plot, Slider, Pane}}, 
 TableDepth -> 2]

enter image description here

share|improve this answer
    
This I steal for the PlotExplorer... Very handy, and was delivered at the perfect time, thanks! –  István Zachar Sep 5 '13 at 19:11
    
You're assuming the graphic is square... –  Brett Champion Sep 6 '13 at 2:40
    
@Brett It is only because an empty Graphics is by default assumed to be square by Mathematica. –  István Zachar Sep 6 '13 at 11:35
    
@Brett I should have mentioned that it's the horizontal size that matters. I'll update the answer. –  Szabolcs Sep 6 '13 at 13:22

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.