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.

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
3  
@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
2  
Currently you have 41% accept rate out of 22 questions you asked. You should give feedback and gratitude to the community that is helping you. –  Vitaliy Kaurov Nov 27 '12 at 17:08
add comment

1 Answer

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
add comment

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.