Mathematica Mathematica: Plot a vector NOT against the component number

AI Thread Summary
To plot a list object against a custom scale derived from a function of the component number, one can create a new scale using a defined function. In the example provided, a list of values is transformed by applying a function (n^2) to the range of the list's length. The resulting scale is then paired with the original list values using Transpose. This method effectively allows for plotting the list against a non-standard scale, achieving the desired visualization with ListPlot.
faradayslaw
Messages
48
Reaction score
0
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
 
Physics news on Phys.org
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]
 
worked well, thanks
 

Similar threads

Back
Top