Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Axis in two scales

  • To: mathgroup at
  • Subject: [mg92585] Re: Axis in two scales
  • From: Ray Koopman <koopman at>
  • Date: Tue, 7 Oct 2008 07:04:16 -0400 (EDT)
  • References: <gcchas$s1q$>

On Oct 6, 1:13 am, Nacho <ncc1701... at> wrote:
> Hello everyone.
> I have a dataset in pairs (x,y) that I would like to plot. The main
> problem is that the data set has interesting parts in the beginning
> that I would like to view clearly.
> As an example, create the following table:
> t = Table[{x, If[x < .5, Sin[100*x], Sin[x]]}, {x, 0, 5, 0.001}];
> ListPlot[t]
> You have a very detailed sine in the beginnng and the rest is less
> interesting.
> I would like to "split" the X axis in two, so the left half of the
> plot covers x={0,0.5} and the second half x={0.5,5}] in the same plot
> and with the right ticks.
> It is like a piecewise axis... is it possible?
> Thanks.

Transform the x-scale. For instance, define

   W[x_] := If[x < .5, x, .5 + (x-.5)/9]

then plot using


For more general situations, consider "nicer" functions such as

  With[{c = 9}, ListPlot[{ArcSinh[c*#[[1]]],#[[2]]}&/@t,

with the parameter (in this case, c) and the list of tick values
adjusted to taste.

  • Prev by Date: Re: Axis in two scales
  • Next by Date: Re: Axis in two scales
  • Previous by thread: Re: Axis in two scales
  • Next by thread: Re: Axis in two scales