RE: Stretching X-Axis in Plot[]

• To: mathgroup at smc.vnet.net
• Subject: [mg45810] RE: [mg45799] Stretching X-Axis in Plot[]
• From: "David Park" <djmp at earthlink.net>
• Date: Mon, 26 Jan 2004 01:53:14 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Harold,

I'm not certain if I completely understand your question, but I'm going to
take it that you just want to produce a low aspect ratio plot.

You can do it if you specify the AspectRatio AND the ImageSize with two
arguments for the ImageSize.

Plot[Sin[x], {x, 0, 30Pi},
AspectRatio -> 0.1,
ImageSize -> {600, 110},
Frame -> True,
PlotLabel -> "Long Sine Wave"];

But notice that the "aspect ratio" of the ImageSize is much greater than the
AspectRatio of the plot. This is because it must make room for the various
labels and these change the overall plot "aspect ratio". The problem is that
there is no easy method to calculate the space taken by the labels.

If one uses...

Plot[Sin[x], {x, 0, 30\[Pi]},
AspectRatio -> 0.1,
ImageSize -> {600, 60},
Frame -> True,
PlotLabel -> "Long Sine Wave"];

a poor plot is obtain.

Mathematica does a poor job of automatically adjusting low aspect ratio
plots and there is something of a loss of exact control here. There is no
way for the user to specify precisely how the graph region, say the Frame in
a Frame plot, will fit into the overall displayed region. For example,
PlotRegion does not refer to the frame region but an overall region
including the labels.

The following plot shows that the PlotRegion extends to the left of the y
frame labels and the y PlotRegion is not very well filled. There is
considerable blank space at the top and bottom.

Plot[Sin[x], {x, 0, 30Pi},
AspectRatio -> 0.1,
ImageSize -> {600, 110},
PlotRegion -> {{0.1, 0.9}, {0, 1}},
Frame -> True,
PlotLabel -> "Long Sine Wave",
Background -> GrayLevel[0.95]];

One solution might be to make PlotRegion refer to the frame or implied
frame, but I'm not certain of all the interactions. It would be nice to have
a better control of the region around the plotted frame.

David Park

From: Harold Noffke [mailto:Harold.Noffke at wpafb.af.mil]
To: mathgroup at smc.vnet.net

MathGroup:

I have a function I want to Plot between 0.5 and 1.0 with a "stretched
out" x-axis.  I want to put a "horizontal magnifying glass" on the
function between 0.65 and 0.75, because it wiggles a lot in this part
of its domain.

I tried to find a Plot option which allows the x-axis to stretch
horizontally across the screen.  I experimented with AspectRatio ->
10, and found I could do y-axis (Range) stretch with no problem.  But
when I tried AspectRatio -> 0.1, the y-axis collapsed, and the x-axis
did not stretch at all.

I'm stumped.  I can't find an x-axis stretching option that produces
more on-screen horizontal plot details.

Does anyone know a way to stretch the x-axis in Mathematica Plots?

Regards,
Harold

```

• Prev by Date: Re: [Outer [Times, , ] ] Question
• Next by Date: Re: [Outer [Times, , ] ] Question
• Previous by thread: Re: Stretching X-Axis in Plot[]
• Next by thread: Re: Stretching X-Axis in Plot[]