Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently we saw how to produce xkcd-style graphs. I evaluated the same code and deployed the result to CDF. Everything is working fine except that, in the CDF notebook, the graph is scaled according to the size of the window.

To start with, we have:

Original size

But, on resizing the window, the graphic also gets smaller:

Resized window

I don't want the graph to be scaled with the window. How can I prevent this?

share|improve this question
@subbu when your question is so badly spelled, formatted, and tagged that people cannot even tell what you are asking, then we have a problem. On this occasion I have cleaned it up, but would ask you to try harder in future. – Oleksandr R. Nov 27 '12 at 16:52
up vote 7 down vote accepted

Give explicit ImageSize option to the final Graphics function that makes your graph. Examples:

  • ImageSize -> Medium
  • ImageSize -> {550, 300}

For the excepted xkcd answer this would be here:

xkcdDistort[p_] := Module[{r, ix, iy}, r = ImagePad[Rasterize@p, 10, Padding -> White];
{ix, iy}=Table[RandomImage[{-1, 1},ImageDimensions@r]~ImageConvolve~GaussianMatrix[10],{2}];
Show[ImagePad[ImageTransformation[r, # + 15 {ImageValue[ix, #], ImageValue[iy, #]} &, 
      DataRange -> Full], -5], ImageSize -> Medium]];

Notice new Show[... , ImageSize -> Medium]

share|improve this answer
what is the final Graphics function name? – subbu Nov 27 '12 at 16:37
@subbu see updated answer – Vitaliy Kaurov Nov 27 '12 at 16:46
@VitaliyKaurov >.< thanks! :D (removed stupid comment of mine) – ssch Nov 27 '12 at 16:50

Your Answer


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.