Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List  
Bill Rowe

Posts: 1,647
Registered: 3/14/08
Re: making a Module or Column that will print lines interspersed with plots
Posted: Feb 3, 2013 8:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/3/13 at 2:46 AM, bwshore@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 else"];

>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 else"];

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

>Print["something else"],

>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:

"something",plota,"something else",plotb}]

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.