       Re: Controlling the scale of x-axis in ListPlot

• To: mathgroup at smc.vnet.net
• Subject: [mg119360] Re: Controlling the scale of x-axis in ListPlot
• From: Peter Breitfeld <phbrf at t-online.de>
• Date: Wed, 1 Jun 2011 04:30:11 -0400 (EDT)
• References: <is2kj4\$qr3\$1@smc.vnet.net>

```You can change the Ticks:

yList = RandomInteger[{1, 5}, 10]
xList = RandomInteger[{1, 100}, 10] // Sort

xTicks = Table[{i, xList[[i]]}, {i, 1, Length[xList]}]
ListPlot[yList, Ticks -> {xTicks, Automatic}]

> Hi,
>
> I need to plot two a vector {y_1,...,y_n} against a vector
> {x_1,...,x_n} and I want to the latter to be distributed with equal
> distances between the elements. Mathematica automatically scales the
> x-axis so that it is linear with respect to the x-values, i.e. if
> x={1,2,10}, then the distance between the second and third element
> will be eight times longer than the distance between the second and
> first element. I would like the distances to be of equal length.
>
> Any ideas?
>
> Cheers,
> Daniel

--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

```

• Prev by Date: Re: FixedPoint[Cos, 1.0]
• Next by Date: Re: FixedPoint[Cos, 1.0]
• Previous by thread: Re: Controlling the scale of x-axis in ListPlot
• Next by thread: Re: Controlling the scale of x-axis in ListPlot