Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Vertical Lines (Boundaries)
Replies: 1   Last Post: Sep 20, 1996 12:48 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Harald Berndt

Posts: 6
Registered: 12/7/04
Re: Vertical Lines (Boundaries)
Posted: Sep 20, 1996 12:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Larry Smith wrote:
>
> After talking to Tech Support today I was able to get a short term fix for
> a problem that I have encountered.
>
> Example: Plot the equation y=x^2 and show boundaries at x=1 and x=2
> (vertical lines). Is there an easy way to do this?
>
> The problem could also be asked where you need to use implicit plotting
> ImplicitPlot[x=y^3,{x,0,3}] and have y horizontal lines at y=1 and y = 2.
> Any suggestions?
>
> So far I only have the following:
>
> Show[Graphics[Line[{{1/2,-1,{1/2,8}}]], DisplayFunction -> Identity]
>
> Plot[x^2,{x,0,2},DisplayFunction -> Identity]
>
> Then combine the previous Out[] which in this case was Out[10] Graphics,
> and Out[11] Graphics
>
> Show[%10,%11, DisplayFunction -> $DisplayFunction]
>


Needing many customizations of plot output, I have really come to
appreciate the Epilog and Prolog options available in all (I think)
plotting functions. In your example, you could simply render the lines
you need by

ImplicitPlot[yourEquation,yourDomain, Epilog ->
{Line[{startPt, endPt}]
]

or


ImplicitPlot[yourEquation,yourDomain, Prolog -> {
anyAndAllOfYourGraphicsPrimitives
}
]

Prolog is the better choice if you specify style options to
distinguish border lines and graph and want the graph to be _in front_
of the border lines (Prolog directives are rendered before the rest of
the plot). Example:

ImplicitPlot[x == y^3,{x,0,3},
PlotStyle -> {GrayLevel[0],
Thickness[0.003]
},
Prolog -> {
GrayLevel[0.5], Thickness[0.01],
Line[{{.5, -1}, {.5, 8}}],
Line[{{2, -1}, {2, 8}}]
}
]

(Note that you'll have to specify PlotStyle in the plot, otherwise the
graph will be rendered with the styles set in the Prolog.)
--
______________________________________________________________________
Harald Berndt, Ph.D. Research Specialist,
Consultant

Phone: 510-652-5974 FAX: 510-215-4299
______________________________________________________________________
"I yam what I yam"...................................Popeye the sailor
(Kryten:............"I thought that was Descartes!"..................)
(Lister:............"So did I. mon, so did I!".......................)









Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.