MathGroup Archive 2009

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

Search the Archive

Re: Graphics and DisplayFunction

  • To: mathgroup at
  • Subject: [mg98273] Re: Graphics and DisplayFunction
  • From: replicatorzed at
  • Date: Sun, 5 Apr 2009 06:33:02 -0400 (EDT)
  • References: <gqsn9m$3tr$> <gr21l6$lq8$>

Of course one can forget about DisplayFunction and use Print, but for
me a more elaborate function does the job:
Since I have plotting functions deeply embedded in code and in
packages (and for other reasons), I actually have to maintain a
DisplayFunction, which - through user-defined switches - redirects
results to various outputs, possibly not just to the actual notebook,
but simultaneously to notebook AND multiple files as well.
Also a problem with your method is that by Printing a Graphics, you
end up with something that is NOT a Graphics object, but in my case (I
don't want to get to the complex details) I definitely need something
in return that is a Graphics object. I have everything working for
years now, just this bit (the topic, i.e. Graphics are not affected by
DisplayFunction) caused some malfunctions in the previous days.

Thanks for the answers anyway.


On Apr 3, 11:11 am, David Bailey <d... at> wrote:
> I would forget about the DisplayFunction option - it is more or less
> obsolete. Just think of graphics as output - just like numbers or equatio=
> If you do a calculation, and then as the last step generate a graphical
> output (either explicitly with Graphics, or indirectly using Plot (say),
> then providing you don't terminate that command with a semicolon, you
> will get your graphical output, for example:
> xx = 10;
> yy = 20;
> Graphics[{Line[{{-xx/2, 0}, {xx/2, 0}}],
>    Line[{{0, -yy/2}, {0, yy/2}}]}]
> If, however, you want to go on and calculate something else (or make
> another graph), simply print your graphical output (again, exactly as
> you would for text):
> xx = 10;
> yy = 20;
> Print[Graphics[{Line[{{-xx/2, 0}, {xx/2, 0}}],
>    Line[{{0, -yy/2}, {0, yy/2}}]}]];
> Print["Something else ",Sqrt[xx]];

  • Prev by Date: Re: Styling the selected Tab's label in TabView
  • Next by Date: Re: Dynamic 2D ListLinePlot PlotRange
  • Previous by thread: Re: Graphics and DisplayFunction
  • Next by thread: Re: Palette Tutorial/training help