MathGroup Archive 2000

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

Search the Archive

Re: Plotting A verticle line?


>Well, after reading some of the posts in this group, this is probably
>going to seem like trivial question, but it's really bugging me:
>How do you get Mathematica to plot a straight verticle line?
>


Thomas,

This would be one way:

Show[Graphics[Line[{{3, -5}, {3, 5}}]],
  PlotRange -> {{-0.001, 6}, {-5.001, 5}}, Axes -> True];

Or you could add the line to another plot this way:

Plot[x^2/6, {x, 0, 6}, Epilog -> {Line[{{3, 0}, {3, 6}}]}];

Or you could use the package ImplicitPlot:

ImplicitPlot[x == 3, {x, 1, 4}, {y, -5, 5},
    PlotRange -> {{-0.001, 6}, {-5.001, 5}, Automatic}];

ImplicitPlot seems to be a little tricky. You have to use the form where both the x
and y range is given, and then if you want to get a nice PlotRange you have to use
three arguments in PlotRange because this is really a contour plot which requires the
third argument.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



  • Prev by Date: Re: generating subsets
  • Next by Date: Re: entering an equation
  • Previous by thread: Re: a question about complex variable
  • Next by thread: Re: Plotting A verticle line?