Re: How to rescale the x-axis in an nonlinear way?
- To: mathgroup at smc.vnet.net
- Subject: [mg112464] Re: How to rescale the x-axis in an nonlinear way?
- From: "David Park" <djmpark at comcast.net>
- Date: Thu, 16 Sep 2010 06:00:48 -0400 (EDT)
I don't know if I understand precisely what is wanted, but with the Presentations package you could use CustomTicks. The problem is that one needs the inverse function. Here is an example. Needs["Presentations`Master`"] x[t_] := 1 + 10^t - E^t In the domain 0 < t < 2 this is monotonic so we can get the inverse function with NDSolve. Clear[t] NDSolve[{t'[x] == 1/x'[t[x]], t[1] == 0}, t, {x, 1, 100}][[1, 1]]; t[x_] = t[x] /. % Then a plot with the new x scale is: xticks = CustomTicks[t, {0, 80, 10, 5}] // Quiet; Draw2D[ {Draw[Tanh[x[t]], {t, 0, 2}, PlotRange -> All]}, Frame -> True, AspectRatio -> 1, PlotRange -> All, FrameTicks -> {{Automatic, Automatic}, {xticks, xticks // NoTickLabels}}] I don't especially like it, but there it is. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: Liyi Li [mailto:llybt.ebay at googlemail.com] Hello, everyone, I am trying to plot out some data and on the x-axis, which is a log- like scale (acutally it is a different function). For example, I want the x sacled like this: 1 + 10^x - E^x, so as the ticks. How can I do that? thank you.