Re: Plotting a Vertical Line
- To: mathgroup@smc.vnet.net
- Subject: [mg11675] Re: [mg11606] Plotting a Vertical Line
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Sat, 21 Mar 1998 18:35:12 -0500
- References: <199803200048.TAA05577@smc.vnet.net.>
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.