MathGroup Archive 2007

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

Search the Archive

Re: Ploting solution sets to compound inequalites

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79764] Re: Ploting solution sets to compound inequalites
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 3 Aug 2007 06:39:06 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f8s21o$52$1@smc.vnet.net>

Diana wrote:
> Math folks,
> 
> How would I plot just an x-axis number line with the solution sets of:
> 
> -2<x<3
> 
> -2<=x<=3
> 
> x<=-2 or x>=3
> 
> x<-2 or x>3
> 
> for example?
> 
> Diana M.
> 
> 

With version below 5.2 and below, you could use *InequalityPlot*. With 
version 6.0 and above, you could use *RegionPlot*.

<< "Graphics`InequalityGraphics`"
ineq = -2 < x < 3;
InequalityPlot[ineq, {x, -4, 4}, {y, -10, 10},
   PlotRange -> {{-10, 10}, All}, ImageSize -> 400,
   Axes -> {Automatic, None}]
ineq = x <= -2 || x >= 3;
InequalityPlot[ineq, {x, -10, 10}, {y, -10, 10},
   PlotRange -> {{-10, 10}, All}, ImageSize -> 400,
   Axes -> {Automatic, None}]

(* 6.0 and above *)
ineq = -2 < x < 3;
RegionPlot[ineq, {x, -4, 4}, {y, -10, 10},
  PlotRange -> {{-10, 10}, All}, Axes -> {Automatic, None},
  Frame -> None]

Regards,
Jean-Marc


  • Prev by Date: Re: Plot a number line
  • Next by Date: Re: Differentiation w.r.t. elements of lists
  • Previous by thread: Re: Ploting solution sets to compound inequalites
  • Next by thread: RE: Where is the Navigate menu item in Workbench 1.1?