MathGroup Archive 2013

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

Search the Archive

Re: making a Module or Column that will print lines interspersed with plots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129673] Re: making a Module or Column that will print lines interspersed with plots
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sun, 3 Feb 2013 20:21:36 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

On 2/3/13 at 2:46 AM, bwshore at me.com (Bruce Shore) wrote:

>I run Mathematica 7. I have some legacy notebooks,   from
>Mathematica 5, in which there were Modules such as

>macro :=Module[{j},
>Print["something"];
>plota;
>Print["something else"];
>plotb
>];

>where plota and plotb were plots. Now with Mathematica 7 the
>semicolons prevent the plots from showing up. Show[plota]; has the
>same problem. The semicolons, which are needed in a Module, prevent
>the plotting.

Your comments above suggest you see the purpose of a semicolon
in Mathematica as being primarily a means for suppressing
output. That isn't true. The purpose of a semicolon is to join
two expressions to make a single compound expression. When you
terminate an expression with a semicolon, what you are really
doing is creating a compound expression with the last part being
Null. And since the output of any compound expression is simply
the output from the last portion, a compound expression ending
in Null produces no output.

The code above can be made to do what you want by explicitly
printing the plots, i.e.,

macro :=Module[{j},
Print["something"];
Print[plota];
Print["something else"];
Print[plotb]]

>I have tried using a Column or a Graphics column,

>macro:=Column[{
>Print["something"],
>plota,
>Print["something else"],
>plotb
>}]

>and this does the printing and the plotting, but all the printing
>comes at the beginning and all the plots come after that. I really
>want the printing to come in between the plots, in the order that I
>show them. How can I do this?

the code above using Column will work if changed as follows:

macro:=Column[{
"something",plota,"something else",plotb}]




  • Prev by Date: Re: Any way to get gradient lines as well as contour lines?
  • Next by Date: Re: exponential regression
  • Previous by thread: Re: making a Module or Column that will print lines
  • Next by thread: Re: making a Module or Column that will print lines interspersed with plots