Re: ContourPlot with variable functions as input
- To: mathgroup at smc.vnet.net
- Subject: [mg118890] Re: ContourPlot with variable functions as input
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 14 May 2011 03:08:55 -0400 (EDT)
- Reply-to: hanlonr at cox.net
P1 = {-1, 1}; P2 = {-(1/7), -(9/7)}; P3 = {1, 1};
Note how Point is used in the Epilog
ContourPlot[{5 + 8 x + 3 y == 0, y == 1},
{x, -10, 10}, {y, -15, 10},
Axes -> True,
AxesLabel -> {x, y},
PlotLabel -> Style[Framed["Conics & tangents."], 16,
Black, Background -> Lighter[Green]],
Frame -> False,
ImageSize -> {550, 400},
Epilog -> {PointSize[0.02], Point[{P1, P2, P3}]}]
{L1, L2} = {5 + 8 x + 3 y == 0, y == 1};
ContourPlot[Evaluate[{L1, L2}],
{x, -10, 10}, {y, -15, 10},
Axes -> True,
AxesLabel -> {x, y},
PlotLabel -> Style[Framed["Conics & tangents."], 16,
Black, Background -> Lighter[Green]],
Frame -> False,
ImageSize -> {550, 400},
Epilog -> {PointSize[0.02], Point[{P1, P2, P3}]}]
Bob Hanlon
---- sigismond kmiecik <sigismond.kmiecik at wanadoo.fr> wrote:
=============
Hello Bob
Another question from a moderately experienced user in Mathematica.
With the code below, I have no problem
P1 = {-1, 1}; P2 = {-(1/7), -(9/7)}; P3 = {1, 1}
ContourPlot[{5 + 8 x + 3 y == 0, y == 1}, {x, -10, 10}, {y, -15, 10},
Axes -> True, AxesLabel -> {x, y},
PlotLabel -> Style[Framed["Conics & tangents."], 16
, Black, Background -> Lighter[Green]],
Frame -> False, ImageSize -> {550, 400},
Epilog -> {PointSize[0.02],
Point[{P1[[1]], P1[[2]]}],
Point[{P2[[1]], P2[[2]]}],
Point[{P3[[1]], P3[[2]]}]
} ]
However I had to hardcode the two functions which were obtained from a
previous Mathematica computation which may change
according to initial parametres supplied (and not end necessarily with
line functions):
Although L1 and L2 look like correct input to Contourplot
In[15]:= L1
Out[15]= 5 + 8 x + 3 y == 0
In[14]:= L2
Out[14]= y == 1
the code below ends up with only dots on the plane (and no error or
warning messages)
ContourPlot[{Evaluate[L1], Evaluate[L2]}, {x, -10, 10}, {y, -15, 10},
Axes -> True, AxesLabel -> {x, y},
PlotLabel -> Style[Framed["Conics & tangents"], 16
, Black, Background -> Lighter[Green]],
Frame -> False, ImageSize -> {550, 400},
Epilog -> {PointSize[0.02],
Point[{P1[[1]], P1[[2]]}],
Point[{P2[[1]], P2[[2]]}],
Point[{P3[[1]], P3[[2]]}]
} ]
How can be this be modified in order to plot everything? What's wrong
with this approach?
Thanks
Best regards
Sigismond Kmiecik