- #1

- 205

- 0

Naturally, I would like to do something like:

YX = { {y1, 1} , {y2,2} , ..... , {yN,N} }

followed by

ListPlot[YX,PlotJoined->True]

My question is: How can I construct YX in a very simple manner?

- Mathematica
- Thread starter brydustin
- Start date

- #1

- 205

- 0

Naturally, I would like to do something like:

YX = { {y1, 1} , {y2,2} , ..... , {yN,N} }

followed by

ListPlot[YX,PlotJoined->True]

My question is: How can I construct YX in a very simple manner?

- #2

- 1,069

- 29

In[1]:= Y={1,5,4}; XY=Transpose[{Y,Range[Length[Y]]}]

Out[2]= {{1,1},{5,2},{4,3}}

Out[2]= {{1,1},{5,2},{4,3}}

- #3

- 205

- 0

But what if the set Y was generated in a loop by some arbitrary means, and I wanted to plot Y, and then trash its values, hold the plot, rerun the calculation generating a new Y, and then plot it along with the first Y, keeping the same domain (X).

I know in matlab we would use the HoldOn function, but is there something like this in mathematica?

- Last Post

- Replies
- 8

- Views
- 5K

- Replies
- 1

- Views
- 5K

- Replies
- 5

- Views
- 5K

- Replies
- 12

- Views
- 3K

- Replies
- 2

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 1K

- Last Post

- Replies
- 2

- Views
- 605

- Last Post

- Replies
- 1

- Views
- 2K

- Replies
- 0

- Views
- 3K

- Replies
- 4

- Views
- 3K