MathGroup Archive 1998

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

Search the Archive

Re: Plotting a Vertical Line



Frank Roescher wrote:
> 
> How do I get Mathematica to plot the graph of x = 3, i.e., a vertical
> line in 2D?  Thanks.

The question is do you just want a vertical line on a graph or do you
actually want a multiple valued function?  If you just want a vertical
line on a graph ,then do something like:

Show[Plot[0,{x,0,5}],Graphics[Line[{{3,-1},{3,1}}]]]

I don't know how to reliably plot a vertical line as a mathematical form
because of the problems in defining such a function in a way that Plot
will always make a nice graph.  Consider, for example,
f[x]=If[x==3,1,0].  This is a function equal to 1 at x=3 and zero
elsewhere.  The first problem is that this is not the same as the
"function" x=3 because x=3 is infinitely multiple valued.  In any
event, the function f[x] will not display properly because Plot always
samples its functions at some interval and will not detect an
infinitely thin function and skip right over it.
-- 
Remove the _nospam_ in the return address to respond.



  • Prev by Date: Re: series expansion of polys with real exponents
  • Next by Date: Re: Plotting a Vertical Line
  • Prev by thread: RE: Plotting a Vertical Line
  • Next by thread: Re: Plotting a Vertical Line