Using Export[] sends the file where?

I am trying to use the Export command to convert a list of plots into a *.gif file, and the command runs and executes well, but I can't find the file! Where is it supposed to go? Did it even work?

Here is my code :

  q[n_, x_] := x (1 + x)^n + x^n;
points = Table[
Map[{Re[#], Im[#]} &,
Flatten[NSolve[q[n, x] == 0, x][[All]] /. Rule -> (#2 &)]], {n, 1, 20}];

Export["domniationrootsstargraph.gif",
Table[ListPlot[points[[i]], PlotRange -> {{-15, 4}, {-10, 10}}], {i, 1, 20, 1}]
]


-
You can specify the full path. Windows example: Export["c:\\a.gif", img] –  belisarius Jul 21 '12 at 22:27
I added a few more tricks in the answer, I hope it helps too ;-) –  Vitaliy Kaurov Jul 21 '12 at 22:44

Easy to check:

Directory[]


Which in my case on Win7 gives:

"C:\Users\vitaliyk\Documents"

You can always specify a complete path to a destination you'd like to save with, for example, top menu Insert >> FilePath which will bring a standard browse-directory window:

This would go instead of your "domniationrootsstargraph.gif". A useful trick to know is command

SetDirectory[NotebookDirectory[]]


which will allow saving your files by default (without full-path specification) into the directory where your notebook is saved. Also to check files in the CurrentDirectory use

FileNames[]


or, for example,

FileNames["*.gif"]


for specific file types.

-
Thank you! Exactly what I wanted. –  Patrick Da Silva Jul 21 '12 at 22:27

Just to add a slightly different method; something I like to do, since I am fairly OCD about always working in a notebook which is already saved in some directory, is to use NotebookDirectory:

Export[NotebookDirectory[]<>"test.gif",list]


This saves your file in the same directory as your .nb file, and is fairly easy to remember in a pinch.

-
This only works if the Notebook has first been saved. +1 nevertheless –  Mr.Wizard Nov 9 '12 at 8:47

You might try

Export[SystemDialogInput["FileSave", "domniationrootsstargraph.gif"],
Table[ListPlot[points[[i]], PlotRange -> {{-15, 4}, {-10, 10}}], {i, 1, 20, 1}]]


This will let you pick the directory interactively.

-

Try this, one I compiled for my thesis writing:

Export2PDF[PlotName_] :=
Module[{A = 600},
StringJoin[{ToString[FileName], ".pdf"}]], PlotName,
"AllowRasterization" -> True, ImageSize -> 360,
ImageResolution -> A]]


Plot example:

Plot1 = Plot3D[
Sin[x] Sin[y], {x, -\[Pi], \[Pi]}, {y, -2 \[Pi], 2 \[Pi]}]


Output:

Export Code:

Export2PDF[Plot1]


Dialog Box:

SAVE and DONE !

-
You can also right-click the figure and choose Save As... I won't give you quite as much control over the options though. –  Szabolcs May 12 '13 at 18:36