1
$\begingroup$

I have this plot

Plot[Sin[x], {x, 0, 10}, Frame -> True, ImageSize -> 200, 
 PlotStyle -> Red]   

enter image description here

I would like to change the size along x and y independently because AspectRatio changes the size for both by scaling. I want to get a fixed size along x and vary the size along y or vice versa, e.g like this

enter image description here enter image description here enter image description here

$\endgroup$

2 Answers 2

4
$\begingroup$
Manipulate[
   Plot[
      Sin[x]
      , {x, 0, 10}
      , Frame -> True
      , ImageSize -> {xrange, yrange}
      , PlotStyle -> Red
      , AspectRatio-> yrange/xrange
   ]
   ,{xrange,100,500}
   ,{yrange,100,500}
]

enter image description here enter image description here

$\endgroup$
2
$\begingroup$

I want to get a fixed size along x and vary the size along y or vice versa, e.g like

Iam not sure why you say AscpectRatio did not work for you? But may be I misunderstood something.

Plot[Sin[x], {x, 0, 10}, Frame -> True, ImageSize -> 200, 
   PlotStyle -> Red, AspectRatio -> #] & /@ Range[4]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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