Mathematica Mathematica: Plot a vector NOT against the component number

Click For 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

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K