Re: Re: Plots from Previous Session
- To: mathgroup@smc.vnet.net
- Subject: [mg11805] Re: [mg11790] Re: Plots from Previous Session
- From: Olivier Gerard <jacquesg@mail.pratique.fr>
- Date: Tue, 31 Mar 1998 02:28:25 -0500
- References: <6fd520$6a6@smc.vnet.net>
At 7:25 +0200 28/03/98, Paul Abbott wrote: >Exporting Graphics > >Q: I want to save a Mathematica graphic to a file as a GIF image. Can I >export the graphic from a notebook without re-executing the code that >created it? > >John Fultz (jfultz@wolfram.com) answers: Display can accept a cell >expression as well as a graphics expression. Here is a function that >pulls the cell expression from the notebook and sends it to Display, >thus avoiding recomputing the graphic in the kernel: > > DisplayNotebookGraphic[f_String, n_Integer, t_String] := > Display[f, Cases[NotebookGet[EvaluationNotebook[]], > Cell[GraphicsData[___], ___], -1][[n]], t] > With this code, when a user has expanded the image before processing it will create a file with the right size but only the part corresponding to standard size will be filled with (part of) the plot, the remaining will be blank). This is at least what I observe with my Mathematica 3.0.1 version on Power Macintosh while exporting GIF images. I did not succeed in improving the original version to take this kind of parameters into account correctly. (My idea was to extract the options at the end of the cell expression and reinject or mix them into the Display command after the three parameters. I have not succeeded in saving a graphics more than StandardSize with all its content as a GIF. Moreover, Display does not seem to have the same behavior when saving a Graphics output of the current session and when saving a cell of a previous session. For instance in the first case, tickmarks of a plot have disappeared while they were conserved when saving with John Fultz routine. It is reminiscent of the behaviour of Show with Plot options such as Axes. Olivier