Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1920
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.glorb.com!news-out.readnews.com!transit3.readnews.com!nx02.iad01.newshosting.com!newshosting.com!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail |
|---|---|
| From | AES <siegman@stanford.edu> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: and color via PlotStyle |
| Date | Sat, 30 Apr 2011 09:51:25 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <ipgm2t$8op$1@smc.vnet.net> (permalink) |
| References | <ipe7mj$r1o$1@smc.vnet.net> |
| Lines | 60 |
| NNTP-Posting-Date | 30 Apr 2011 08:52:10 GMT |
| NNTP-Posting-Host | b9b93cc9.news.twtelecom.net |
| X-Trace | DXC=Sg[?:ieblcRn`k2nf64]0\C_A=>8kQj6];[h;PUXBgbTVonPDX8c=A]EFiONJ7[GoV4<8YV[NOHIW |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1920 |
Show key headers only | View raw
In article <ipe7mj$r1o$1@smc.vnet.net>,
Bill Rowe <readnews@sbcglobal.net> wrote:
>
> >Plot[{ a x, a x^2, a x^3}/. {a -> 1},{x, 0, 2},
> >PlotStyle -> {Red, Green, Blue}]
>
> >just produces blue plots.
>
> Exactly as it should.
The statement "Exactly as it _should_" is open to discussion here.
Consider an "ordinary user" (a user attempting to use Mathematica to do
some simple but useful task) who is at a level of sophistication where
he/she understands the Plot command; how to use it to plot a List of
functions {f1,f2,f3}; the use of simple PlotStyles; and the use of the
"\." syntax нн but has never had to encounter the concepts of Hold or
Evaluate.
After all, having a rudimentary understanding of Plot, PlotStyle, the \.
syntax, and lists (which are all relatively simple, understandable,
learnable commands that do familiar things) permits this user to do many
useful tasks нн and to do themwithout ever having any interaction with
the much more complex and arcane (and much less standard or familiar in
ordinary life) concepts of Hold and Evaluate.
This mythical user might then well be forgiven for thinking that the two
commands
a = 1;
Plot[{ a x, a x^2, a x^3}, {x, 0, 2},
PlotStyle -> {Red, Green, Blue}]
Plot[{ a x, a x^2, a x^3}/. {a -> 1}, {x, 0, 2},
PlotStyle -> {Red, Green, Blue}]
_should_ do exactly the same thing, except that the first form will also
obviously leave a assigned the value 1 in subsequent cells.
But of course, this is not what happens, and so the user who uses the
second form (perhaps doing so for compactness, or perhaps wanting to
make a test Plot of their List without setting a to a fixed value)
encounters another of the copious supply of puzzling Mathematica
"gotchas".
I'm not arguing that this outcome is in some sense "wrong", or in any
way a bug. There may be -- probably are -- deep reasons, buried deep in
the logic and design of Mathematica, as to why Plot has to function in
this way (or maybe an unnecessary design decision was made that Plot
would function in this way to simplify other aspects of Mathematica
programming?).
But it's still unfortunate that it does operate this way. Would you
(and maybe Helen ??? in Washington) really want to argue that high
school students, or freshman students in college, should have to first
go through a tutorial in Hold and Evaluate (and maybe also HoldAll,
HoldFirst, NHoldAll, HoldAllComplete, HoldRest, SequenceHold, Extract,
and Unevaluated) before they could start plotting Lists using Plot?
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Re: and color via PlotStyle AES <siegman@stanford.edu> - 2011-04-30 09:51 +0000 Re: and color via PlotStyle Helen Read <readhpr@gmail.com> - 2011-05-01 10:22 +0000 Re: and color via PlotStyle Dushan Mitrovich <dushanm@spinn.net> - 2011-05-02 10:51 +0000
csiph-web