Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Embed Plot into External File' topicStudent Support Forum > General > Archives > "Embed Plot into External File"

Help | Reply To Topic
Author Comment/Response
Isaac Abraham
02/17/12 3:43pm

How can I get Mathematica 7 to insert a plot into an external file? I can splice it, but the plot comes up as a list of numbers rather than a rendered image.

I can see that I can successfully splice equations, if i replace the references to the figure, so the general method seems to be be ok - just that i can't see a rendered figure in my out.f file that is finally created.

--------------------------------------------
p = Plot[ Sin[x], {x,0,2 Pi}];

savimg = Export["/Path/fig.jpg","JPEG"];
getimg = Import["/Path/fig.jpg"];

outfile = "/Path/out.mf";
str = OpenWrite[ outfile ];
Write[str, OutputForm[ " <* getimg *> "];
Close[str];
Splice[outfile];

--------------------------------------------

URL: ,
Help | Reply To Topic