Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica: Plot a vector NOT against the component number

  1. Nov 19, 2011 #1
    Hi,

    I wish to listplot a list object against a scale that is NOT the component number of the vector, but is actually a well defined function of the component number, and I am lost how to do this?

    changing "Ticks" didn't help, or I did it wrong, so I am wondering if anyone knows how to do this.

    Thanks
     
  2. jcsd
  3. Nov 19, 2011 #2
    Construct your substitute for the "component number" and transpose to put it in position

    Example:

    mylist = {1, 2, 7, 4};
    myf[n_] = n^2;
    myscale = Map[myf, Range[Length[mylist]]];
    myresult = Transpose[{myscale, mylist}];
    ListPlot[myresult, PlotJoined -> True, AxesOrigin -> 0]
     
  4. Nov 19, 2011 #3
    worked well, thanks
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook