Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: How create vertical line using Plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104237] Re: How create vertical line using Plot?
  • From: Max <jgoldfar at gmail.com>
  • Date: Sun, 25 Oct 2009 01:03:35 -0400 (EDT)
  • References: <hbu7s7$7ic$1@smc.vnet.net>

On Oct 24, 2:46 am, davef <davidfrick2... at yahoo.com> wrote:
> How can I create a vertical line using the Plot command?
>
> I can hack it using "y" = very big number times "x" but is there a
> more elegant way to do it?

The best ways to plot vertical lines on your plots don't involve
functions of "x", or the Plot command; for example, we can use the
Epilog command on Plot to give us a vertical line drawn between some
pair of points:
Plot[f[x],{x,xmin,xmax}, Epilog->Line[{xval,ymin},{xval,ymax}]]
will plot f from xmin to xmax, and have a vertical line at xval (so
long as xval is in (xmin,xmax)) and you should also take care to see
that ymin and ymax fall within your plot area.

We could also use ParametricPlot:
ParametricPlot[{{xval,u},{u,f[u]}}, {u,umin,umax}]
should give a vertical line at some position "xval," and plot "f"
along the x axis.  The documentation center is your friend here; I may
have written these down slightly incorrectly, but experimentation and
documentation should clear that up for you.

-Max


  • Prev by Date: Re: Re: which values of m satisfies the inequality
  • Next by Date: Re: comparable sizes across BubbleCharts
  • Previous by thread: Re: How create vertical line using Plot?
  • Next by thread: Re: How create vertical line using Plot?