Message Boards Message Boards

0
|
5057 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Plot two outputs of a function (like x^1/2)?

Posted 8 years ago
ContourPlot[{y == E^ProductLog[Log[x]], y == x^x, y == x, y == x + 1, 
  y == x - 1}, {x, -1, 3}, {y, -1, 3}]

enter image description here

Notice how y == E^ProductLog[Log[x]] (which is the inverse of y=x^x) is cut off for y < e^(-1). What can I do (other than just typing x==y^y) to get Mathematica to show the values that it's cutting out? The same problem exists for y==x^(1/2). I know I could just type x==y^2, but that's not what I'm looking to do. Basically, how do I specify for Wolfram Mathematica to plot these values when it creates multiple outputs from one input? (Instead of just using the "principal square root" or whatever.)

POSTED BY: John Travolski
4 Replies

You can simply write x == y^y instead of y == E^ProductLog[Log[x]] in your original ContourPlot:

ContourPlot[{x == y^y, y == x^x, y == x, y == x + 1, 
  y == x - 1}, {x, -1, 3}, {y, -1, 3}]
POSTED BY: Gianluca Gorni
Posted 8 years ago

Thanks, it works well!

POSTED BY: John Travolski

Use a ParametricPlot instead,

ParametricPlot[{{x, x^x}, {x^x, x}}, {x, -1, 3}, 
 PlotRange -> {-1, 3}]
ParametricPlot[{{Sin[x], x}}, {x, -3, 3}, 
 PlotRange -> {-3, 3}]

Mathematica graphics

POSTED BY: Jason Biggs
Posted 8 years ago

Perhaps an easier example would be this; if I want to graph y==ArcSin[x], how do I plot all of the values instead of just this: enter image description here

I'm looking for the entire sine wave that's just along the y-axis instead of just that part of it.

POSTED BY: John Travolski
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