MathGroup Archive 2006

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

Search the Archive

Re: Send graphics to file AND/OR to notebook with one DisplayFunction

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71520] Re: [mg71495] Send graphics to file AND/OR to notebook with one DisplayFunction
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Tue, 21 Nov 2006 07:05:18 -0500 (EST)
  • References: <200611202311.SAA18412@smc.vnet.net>

I haven't thought of an answer yet, but you may want to look at the
contents of PSDirect.m and maybe some of the package definitions that
do image handling for web Mathematica (though I can't find them right
now) (and yes, they are in regular Mathematica Student Edition).

On 11/20/06, zac <replicatorzed at gmail.com> wrote:
> Hi All,
> I've posted this problem on Wolfram's Student Support Forum, but no
> full answer was given to it.
>
> I've got this problem with Display:
>
> Plot[x, {x, 0, 5}, DisplayFunction -> (Display[{"stdout", "test.gif"},
> #1, "GIF"]&)];
>
> where the given format "GIF" seems to collide with the standard output.
> The target is to both display the plot in the notebook, and to save it
> into a file. If I don't feed the 3rd argument ("GIF"), the plot does
> appear in the notebook, and a file is being generated, although it is
> an empty gif file.
>
> In more detail: the problem is that I want to make both the
> notebook-display and the file saving be independently suppressable.
> Take for example the code below:
>
> Plot[x, {x, 0, 5},DisplayFunction ->
> Which[
> askToFile && askToConsole, (Display[{"stdout", "test.gif"}, #1, "GIF"]
> &),
> askToFile && ! askToConsole, (Display["test.gif", #1, "GIF"] &),
> ! askToFile && askToConsole, (Display[$Display, #1] &),
> ! askToFile && ! askToConsole, Identity
> ];
> ];
>
> where the variables askToFile and askToConsole are booleans.
>
> As far as I know, Export cannot be suppressed "from the inside".
> Furthermore, I do not want to make two statements, one for displaying
> the graphic with Plot (or Show), and one for saving it with Export. It
> seems to me that defining a new $DisplayFunction would be the best
> solution.
>
> Any help would be appreciated.
>
> Istvan
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Send graphics to file AND/OR to notebook with one DisplayFunction
  • Next by Date: Re: ComplexityFunction affects set of transformations tried by Simplify
  • Previous by thread: Send graphics to file AND/OR to notebook with one DisplayFunction
  • Next by thread: Re: Send graphics to file AND/OR to notebook with one DisplayFunction