Message Boards Message Boards

0
|
8762 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Switching the X and Y axis in a ListLinePlot

Hello and thanks for checking out the post.

I have here a few lines of very simple code.
Rexp = {.21, .25, .3};
texp = {0, 1000, 2000};

ListLinePlot[{texp, xexp}]
This graph is just a simple line based on the numbers of text and xexp. All I want to do is switch their axis.  Right now the texp is on the Y axis and the xexp is on the X axis. How do you switch them so that I may be able to use 'Show[]' to put two plots on one graph.  Would someone be able to tell me how to do this?

I have looked everywhere I could for a solution, but I can't find anything.

Thanks,
Vardo
2 Replies
ListLinePlot[(Transpose[{texp, xexp}] /. {t_, x_} -> {x, t})]
In other words,
ListLinePlot[Transpose[{xexp, texp}]]
POSTED BY: Ilian Gachevski
Posted 12 years ago
Vardo,

if I understand correctly, then after plotting x[ t ] of your data
xexp = {.21, .25, .3};
texp = {0, 1000, 2000};
ListLinePlot[Transpose@{texp, xexp}]
you would now like to plot t[ x ] :
ListLinePlot[(Transpose[{texp, xexp}] /. {t_, x_} -> {x, t})]

Hope this helps,
Peter
POSTED BY: Peter Fleck
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract