MathGroup Archive 2003

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

Search the Archive

Re: Why Plot cannot run under package?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39646] Re: Why Plot cannot run under package?
  • From: "Roland Nilsson" <rolle at ifm.liu.se>
  • Date: Thu, 27 Feb 2003 00:28:27 -0500 (EST)
  • Organization: Island, Linkoping University, Sweden
  • References: <b3hshl$ild$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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
header.

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?