Message Boards Message Boards

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

ContourPlot and list of implicit equations

Posted 1 year ago

Hello,

I have read that ContourPlot[] must be used for plotting implicit equations. Is it right?

Using ContourPlot[], the following code works right:

clr = {Green, Red};
plots = ContourPlot[{3 x^2 + y^2 - 9 == 0, 
    x^2 + y^2 - 1 == 0}, {x, -4, 4}, {y, -4, 4}, 
   ContourStyle -> Map[{clr[[#]], Thickness[0.005]} &, {1, 2}], 
   PlotLegends -> True, Frame -> True, FrameTicks -> False];   
Show[plots]

But it does not works when curves are grouped in a list:

clr = {Green, Red};
eqs = {3 x^2 + y^2 - 9 == 0, x^2 + y^2 - 1 == 0};
plots = ContourPlot[eqs, {x, -4, 4}, {y, -4, 4}, 
   ContourStyle -> Map[{clr[[#]], Thickness[0.005]} &, {1, 2}], 
   PlotLegends -> True, Frame -> True, FrameTicks -> False];   
Show[plots]

I am trying to write a module receiving a list of implicit curves and plotting them in a single graphics.

Any suggestion for making possible the second option?

Thanks in advance,

César Lozada

POSTED BY: Cesar Lozada
2 Replies
Posted 1 year ago

Hello Bill,

Thank you very much.

Best regards.

POSTED BY: Cesar Lozada
Posted 1 year ago

This

eqs = {3 x^2 + y^2 - 9 == 0, x^2 + y^2 - 1 == 0};
plots = ContourPlot[eqs, {x, -4, 4}, {y, -4, 4}]

gives a blank plot

This

eqs = {3 x^2 + y^2 - 9 == 0, x^2 + y^2 - 1 == 0};
plots = ContourPlot[Evaluate[eqs], {x, -4, 4}, {y, -4, 4}]

gives the desired plot

POSTED BY: Bill Nelson
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