ImageSize

ImageSize
is an option that specifies the overall size of an image to display for an object.

DetailsDetails

  • The following settings can be given:
  • wwidth specified by w
    {s}maximum width and height specified by s
    {w,h}explicit width and height
    {{wmax},{hmax}}width and height maximums
    {{wmin,wmax},{hmin,hmax}}width and height ranges
  • Specifications for both width and height can be any of the following:
  • Automaticdetermined by location or other dimension (default)
    Tiny, Small, Medium, Largepre-defined absolute sizes
    dd printer's points (before magnification)
    72didi inches (before magnification)
    Fullfill out the enclosing region
    Scaled[s]a fraction s of the enclosing region
    Allsize that fits all objects in a collection
  • With ImageSize->{w, h} an object will always be drawn in a wh region, and will be sized to fit in the region.
  • If the object has a definite aspect ratio that is not , then space will be left around it.
  • The position of the object within the wh region is determined by the setting for the object's Alignment option.
  • With ImageSize->{{wmax}, {hmax}}, an object is sized so that its width and height are as large as possible while not exceeding the specified maximums.
  • No extra space is then left around the object, so that the region in which the object is drawn is always the same shape as the object itself.
  • ImageSize->{s} is equivalent to ImageSize->{{s}, {s}}.
  • With ImageSize->{{wmin, wmax}, {hmin, hmax}}, the object is sized to be as large as possible while not exceeding specified maximums, with extra space being left if necessary in order to satisfy the minimums.
  • ImageSize->{{smin, smax}} is equivalent to ImageSize->{{smin, smax}, {smin, smax}}.
  • Objects maintain a fixed aspect ratio when resized by ImageSize specifications, except when the objects have AspectRatio->Full.
  • ImageSize->w is equivalent to ImageSize->{w, Automatic}.
  • ImageSize->{Automatic, h} normally determines image size from height, with width left unconstrained.
  • Symbolic settings such as ImageSize->Small define width and height maximums, with no extra space being left.
  • For an object that appears directly in a notebook cell, ImageSize->Full corresponds to the full width of the content area for the cell.
  • When the cell is printed, ImageSize->Full corresponds to the full width of the content area of the page.
  • For an object that appears as an element in a Grid, ImageSize->Full corresponds to the full width of the cell in the grid.
  • ImageSize is an option not only for Graphics, but also for objects such as Slider, Button, Pane, and Grid. ImageSize is also an option for Export.
  • Settings such as Automatic and Small yield different image sizes for different objects.
  • For constructs such as SlideView, TabView, or Toggler, ImageSize->All specifies that a fixed image size should be used that fits all possible elements that can be displayed. ImageSize->Automatic specifies that the image size should be determined by the currently displayed element.
  • ImageSize->All by default refers to both width and height; ImageSize->{Automatic, All} leaves enough vertical space for all images, but adjusts horizontal space separately for each image.
  • For a graphic with ImageSize->Automatic that appears directly in a notebook cell, the image size is determined by the ImageSize setting for the style of the cell.
  • Graphics with ImageSize->Automatic are rendered smaller when they appear in lists or grids, and even smaller when they appear in text-like constructs.
  • Some settings of BaselinePosition are incompatible with the Full and Scaled settings of the vertical dimension of ImageSize. When these settings conflict, the BaselinePosition setting will supercede the ImageSize setting.

ExamplesExamplesopen allclose all

Basic Examples (5)Basic Examples (5)

Use predefined symbolic sizes:

In[1]:=
Click for copyable input
Out[1]=

Use an explicit image width:

In[1]:=
Click for copyable input
Out[1]=

Use an explicit image width and height:

In[1]:=
Click for copyable input
Out[1]=

Use a size proportional to the enclosing area:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Specify the sizes of controls:

In[1]:=
Click for copyable input
Out[1]=
New in 3 | Last modified in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »