9
$\begingroup$

If I execute MatrixPlot@IdentityMatrix@100, the result is a good size. However, if I evaluate

Grid[{{200!}, {MatrixPlot@IdentityMatrix@100}}, ItemSize -> Automatic]

the MatrixPlot is much smaller, even when the page is wide. How can I make the MatrixPlot appear at its original size in the Grid? I'd prefer not to hard-code the size.

this picture

The picture shows that the second MatrixPlot is too small.

$\endgroup$
1
  • 2
    $\begingroup$ Automatic != Automatic so why not just use ImageSize for MatrixPlot? $\endgroup$
    – Kuba
    Commented Oct 25, 2013 at 6:19

2 Answers 2

14
$\begingroup$

If you set ImageSizeMultipliers -> 1 then the graphics will not be downsized when appear inside list-like constructs:

Style[
     Grid[{{200!}, {MatrixPlot@IdentityMatrix@100}}, ItemSize -> Automatic],   
     ImageSizeMultipliers -> 1]

Alternatively,

Grid[{{200!}, {MatrixPlot@IdentityMatrix@100}}, ItemSize -> Automatic,
  BaseStyle -> ImageSizeMultipliers -> 1]

or

Grid[{{200!}, {MatrixPlot@IdentityMatrix@100}}, ItemSize -> Automatic,
  ItemStyle -> ImageSizeMultipliers -> 1]

give the same output.

$\endgroup$
5
$\begingroup$

Although he puts it somewhat obliquely, Kuba is giving you good advice in his comment. When you place a graphics object into a Grid or Column construct and care even a little about its size, explicitly make the setting of the ImageSize option in the graphics object.

notebook.png

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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