Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ContourPlot, equation and R.H. side of equation_Plotting problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99079] Re: ContourPlot, equation and R.H. side of equation_Plotting problem
  • From: Erik Max Francis <max at alcyone.com>
  • Date: Sun, 26 Apr 2009 01:39:23 -0400 (EDT)
  • References: <gsuirn$dr2$1@smc.vnet.net>

Bill wrote:
> Hi:
> 
> 1a.) When I assign 3 x^2 + 6 y^2 == 6 to eqn1, in Mathematica like this:
> 
> eqn1=3 x^2 + 6 y^2 == 6;
> 
> I can't get ContourPlot to plot eqn1 using this code:
> 
> ContourPlot[eqn1, {x, -2, 2}, {y, -2, 2}, Axes -> True]
> 
> 
> 1b.) If I assign the equation like this without the constant on the R.H. side in eqn2, 
> ContourPlot will plot the equation as expected, using the following syntax:
> 
> eqn2=3 x^2 + 6 y^2;
> ContourPlot[eqn2 == 6, {x, -2, 2}, {y, -2, 2}, Axes -> True]
> 
> 
> Question: How can I get method 1a to work? Could you please give me code for this?

I'm not exactly sure why it's happening, but I see it too.  Seeing that 
ContourPlot has attribute HoldAll, I'm guessing this is another 
misfiring heuristic that's attempting to determine what class of plot 
it's being asked to handle and failing.

I found you can bypass the problem by putting an explicit Evaluate call 
in there:

	ContourPlot[Evaluate @ eqn1, {x, -2, 2}, {y, -2, 2}, Axes->True]

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M, Skype erikmaxfrancis
   The hour which gives us life begins to take it away.
    -- Seneca


  • Prev by Date: Re: issues with GraphPlot
  • Next by Date: Re: Copy/paste selection of a pdf on Mac
  • Previous by thread: Re: ContourPlot, equation and R.H. side of equation_Plotting problem
  • Next by thread: Re: ContourPlot, equation and R.H. side of equation_Plotting problem