3
$\begingroup$

This question already has an answer here:

Is there any way to control the size of output graphics when using simple Grid command?

Here is an example code:

Do[Subscript[a, i] = Plot[Sin[x + Pi*0.25*i], {x, 0, 12*Pi}], {i,3}];
Subscript[a, 1]
Transpose[Table[{Subscript[a, i]}, {i, 3}]] // MatrixForm

Outputting a single plot returns a full size object, outputting a stack returns reduced size ones.

Using GraphicsGrid is not a solution in my case, because I have a huge stack of plots which results in huge size of image to build and takes a very long time to complete.

$\endgroup$

marked as duplicate by Mr.Wizard Mar 8 '15 at 23:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ Does adding the option ImageSize->n for some suitable value of n to each of your plots fix this for you? $\endgroup$ – Bill Mar 4 '15 at 15:54
  • $\begingroup$ Please add sample code to make this question answerable and more useful. $\endgroup$ – Yves Klett Mar 4 '15 at 16:07
  • $\begingroup$ Great thanks for all replies! I added code to my question above. I usually use Grid or MatrixForm to visualise a stack of graphs, ImageSize returns error when using with latter functions. $\endgroup$ – Bulat Munavirov Mar 4 '15 at 20:59
  • $\begingroup$ I would recommend using Grid, which offers lots of layout options. $\endgroup$ – Yves Klett Mar 7 '15 at 15:46
  • $\begingroup$ I use Grid too, but do you know exactly how it is possible to control the size of the plot there? There is an ItemSize option in Grid, but it doesn't solve the problem. $\endgroup$ – Bulat Munavirov Mar 7 '15 at 15:50
4
$\begingroup$

My preferred work-around for this is to add Pane to each graphic. This prevents the default shrinking. It however still allows resizing to fit the screen width, which usually for me is a positive attribute. If you specify an absolute ImageSize such as the default 360 no resizing takes place and the graphics are clipped by the Notebook window.

{Array[Pane @ Subscript[a, #] &, 2]} // Grid
{Array[Pane @ Subscript[a, #] &, 3]} // Grid
{Array[Show[Subscript[a, #], ImageSize -> 360] &, 3]} // Grid

enter image description here

$\endgroup$
4
$\begingroup$

Update: You can re-set the value of the option ImageSizeMultipliers at the notebook, front-end-session or front-end levels.

Default value this option is

Options[EvaluationNotebook[], ImageSizeMultipliers]
(* {ImageSizeMultipliers -> {0.5, 0.25}} *)

If you set this option value to {1,1} using

SetOptions[EvaluationNotebook[], ImageSizeMultipliers -> {1, 1}]

then all graphics/images are in the current notebook are re-rendered in their original size: enter image description here


Original post:

You can wrap each plot with Style[#, ImageSizeMultipliers -> {1, 1}]& to ensure that graphics are rendered in their original size inside other constructs (see ImageSizeMultipliers).

plots = Table[Plot[Sin[x + Pi*0.25*i], {x, 0, 12*Pi}], {i, 3}];
plots[[1]]
{plots} // Grid
{Style[#, ImageSizeMultipliers -> {1, 1}] & /@ plots} // Grid

enter image description here

$\endgroup$
  • $\begingroup$ kguler, do you think this should be closed as a duplicate of (72573)? I believe your (unique) answer is equally valid there. $\endgroup$ – Mr.Wizard Mar 8 '15 at 4:59
  • $\begingroup$ @Mr.Wizard, as it stands it is a special case of the linked q/a. Btw, if this q/a is closed as a duplicate, will it be deleted sometime in the future (if so, it would make sense to post my answer in the linked q/a), or does it stay? $\endgroup$ – kglr Mar 8 '15 at 9:59
  • $\begingroup$ Since the OP switched the Accept to my answer, which is indeed a duplicate, I think I shall close this. Duplicates are not routinely deleted, though there is no promise that they will not some day be deleted. Closed questions that are not duplicates I have been deleting at one year of age. I encourage you to post this ImageSizeMultipliers method to 72573. $\endgroup$ – Mr.Wizard Mar 8 '15 at 23:15
1
$\begingroup$
plots = DateListPlot[CountryData[#, {"Population", {1800, 2020}}], 
     PlotLabel -> "population of " <> #, 
     ImageSize -> 250] & /@ {"Poland", "Austria", "Switzerland", 
    "Germany"};

GraphicsGrid[{{plots[[1]], plots[[2]]}, {plots[[3]], plots[[4]]}}, 
 ImageSize -> 500]

enter image description here

sol = Solve[{2 x + 3 y == 5, 3 x + 4 y == 11}];
xyVals = {x, y} /. sol;
p1 = Plot[(5 - 2 x)/3, {x, -5, 5}, PlotRange -> 5, Frame -> True, 
   AspectRatio -> 1, ImageSize -> Small];
p2 = Plot[(11 - 3 x)/4, {x, -5, 5}, PlotRange -> 5, Frame -> True, 
   AspectRatio -> 1];
cp1 = ContourPlot[{2 x + 3 y == 5, 3 x + 4 y == 11}, {x, 12, 
    14}, {y, -6, -8}, 
   Epilog -> { Red, PointSize[Large], Point@xyVals}];

enter image description here

$\endgroup$
  • $\begingroup$ GraphicsGrid works fine, but it returns single solid picture! While Grid or //MatrixForm returns a combination of graphics, each of which may be edited manually $\endgroup$ – Bulat Munavirov Mar 4 '15 at 21:11
  • $\begingroup$ Else to be admitted, GraphicsGrid seems to work much slower than Grid $\endgroup$ – Bulat Munavirov Mar 4 '15 at 21:14

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