Message Boards Message Boards

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

ContourPlot[] function does not display all functions entered as a list.

Posted 4 years ago

Hi;

I am having difficulty displaying my two entering functions in the ContourPlot[] function (Please see attached). As my attachment shows, I can enter my two functions individually in two separate ContourPlot[] functions and combine them using the Show[] function, which gives the desired output. However, combining my two functions into a single ContourPlot[] function (as a list) seems to drop one of the plots.

It is probably something that I don't understand, so please guide me back to a working path.

Thanks,

Mitch Sandlin

Attachments:
POSTED BY: Mitchell Sandlin
2 Replies

I think that when you ask for

ContourPlot[{f[x, y], (4 - x) y^2 == x^3},
 {x, -3, 3}, {y, -3, 3}]

it will automatically be translated to

ContourPlot[{f[x, y] == 0, (4 - x) y^2 == x^3},
 {x, -3, 3}, {y, -3, 3}]

Unfortunately f[x, y] == 0 is true only at the origin, and it will not be displayed. Try a different level curve:

ContourPlot[{f[x, y] - 1, (4 - x) y^2 == x^3},
 {x, -3, 3}, {y, -3, 3}]

To get the shading there may be no other way than with Show, as you found out.

POSTED BY: Gianluca Gorni

Interesting!

I have no idea, but it could be because you have two different types of problems in Contourplot (contourplot of a function f[ x, y ] and solve an equation) that CP copes only with one type.

Look at this

f[x_, y_] := x^2 + y^2


ContourPlot[{f[x, y]}, {x, -5, 5}, {y, -5, 5}]   (*  ok  *)
ContourPlot[{f[x, y], x^2 - Sin[y] == 4}, {x, -5, 5}, {y, -5, 5}]   (* doesn't the 1st plot  *)
ContourPlot[{f[x, y] == 6, x^2 - Sin[y] == 4}, {x, -5, 5}, {y, -5, 5}]
ContourPlot[{f[x, y] == 2, f[x, y] == 4, f[x, y] == 6, f[x, y] == 8, x^2 - Sin[y] == 4}, {x, -5, 5}, {y, -5, 5}]
POSTED BY: Hans Dolhaine
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