MathGroup Archive 1997

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

Search the Archive

Re: How to rebase a List of Values?

  • To: mathgroup at
  • Subject: [mg6908] Re: [mg6852] How to rebase a List of Values?
  • From: Xah Lee <xah at>
  • Date: Fri, 25 Apr 1997 14:00:38 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

At 2:44 AM -0400 4/24/97, Patrick Kopitz wrote:
>Say I have one List containing values from 1000 to 5000 and a second from
>30 to 70.
>I want to rebase those lists at 100 so the two will show on a graphic with
>the same scale.

You can rescale your data using this formula (dataPoint-min)/(max-min).
This will put all dataPoint between 0 and 1. (Did I misunderstand the

You can implement it in mma using a pure function and Map. Example:

myList1= Table[Random[Integer,{1000,5000}], 100];
myList2= Table[Random[Integer,{30,70}], 100];

myNewList1 = ( (#-5000)/(5000-1000)& /@ myList1);
myNewList2 = ( (#-30)/(70-30)& /@ myList2);

Show[Graphics[{ Hue[0], First@ ListPlot[myNewList1], Hue[.7], First@

The last line also answers a recent query on how to put two two ListPlot
into one with different color.

Warning: I have not tested the code above, but it should work.

 xah at
 Mountain View, CA, USA
 "Morality abets evil"

  • Prev by Date: Re: Several plots with same colour in same square?
  • Next by Date: Re: Gaussian Matrix Elimination
  • Previous by thread: Re: How to rebase a List of Values?
  • Next by thread: Re: How to rebase a List of Values?