Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13360
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail |
|---|---|
| From | Bill Rowe <readnews@sbcglobal.net> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: making a Module or Column that will print lines interspersed with plots |
| Date | Mon, 4 Feb 2013 01:19:39 +0000 (UTC) |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <ken2bb$7f0$1@smc.vnet.net> (permalink) |
| Lines | 56 |
| Organization | Time-Warner Telecom |
| NNTP-Posting-Date | 04 Feb 2013 01:22:45 GMT |
| NNTP-Posting-Host | 578a6a5e.news.twtelecom.net |
| X-Trace | DXC=LE9]_0cX2>DO>]7?RIA\SKC_A=>8kQj6M9BHNOcEA\@IX64@m:Na78KEFiONJ7[GoFU]dQ>^EXH2H |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | csiph.com comp.soft-sys.math.mathematica:13360 |
Show key headers only | View raw
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"];
>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}]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: making a Module or Column that will print lines interspersed with plots Bill Rowe <readnews@sbcglobal.net> - 2013-02-04 01:19 +0000
csiph-web