1
$\begingroup$

I have created the following package.

BeginPackage["AplicacionCartesiana`"]
AplicacionCartesiana::usage = "AplicacionCartesiana[f, {x0, x1, dx}, \
{y0, y1, dy}] plots the image of the Cartesian coordinates under the \
complex function f."
Begin["`Private`"]
AplicacionCartesiana[func_, {x0_, x1_, dx_}, {y0_, y1_, dy_}] :=
 Module[{xy, x, y, hg, vg},
  xy = func[x + I y];
  hg = Curves[xy, {x, x0, x1, dx}, {y, y0, y1}];
  vg = Curves[xy, {y, y0, y1, dy}, {x, x0, x1}];
  Show[Graphics[Join[hg, vg]],
   AspectRatio -> Automatic,
   Axes -> True]
  ]
Curves[xy_, spread_, bounds_] :=
 With[{curves = Table[{Re[xy], Im[xy]}, spread]},
  ParametricPlot[curves, bounds, DisplayFunction -> Identity][[1]]
  ]
End[]
EndPackage[]

But I want to know where I have to store it in my computer in order to use it (with Get[] or Needs[]) in other mathematica session. Thanks.

$\endgroup$
1
  • 3
    $\begingroup$ You can always use Get[] to load your package from an arbitrary path, e.g. Get["/path/to/AplicacionCartesiana.m"]. $\endgroup$ Commented Nov 15, 2019 at 3:47

1 Answer 1

1
$\begingroup$

You should put it in this folder:

FileNameJoin[{$UserBaseDirectory, "Applications"}]

Packages that you put there will also be automatically available when a new version of Mathematica is installed.

You can also install packages from the File menu, File -> Install. It will place the file in the same folder as mentioned above, as I recall (it's been a while.)

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.