MathGroup Archive 2003

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

Search the Archive

Re: Why Plot cannot run under package?

Hi there,

now, I'm pretty new to Mathematica myself, but I had som similiar trouble
with my first packages. The context handling is quite unintuitive at times
(imho), so things like this tends to pop up...

When you start a new package with

> BeginPackage["Enhancements`DiscoverRoots1`"]

Mathematica will alter your $ContextPath (only System` is accessible by
default I think), so that Plot is not accessible. This is probably to avoid
other strange name clashes. Your code line

>           Plot[CurveEquation[x], RootLocation, MaxBend -> 10,
>             PlotDivision -> 20];

thus will introduce a new symbol "Plot" in your package`Private` context,
not refer to the Plot you want. To avoid this you must put the graphics
package back on the $ContextPath by calling Needs on it in the package

Hope this helps.

  • Prev by Date: Re: PDF Graphics from Mathematica
  • Next by Date: Re: Domain of Sin[ArcSin[x]] ?
  • Previous by thread: Why Plot cannot run under package?
  • Next by thread: Re: Why Plot cannot run under package?