RE: Clever Tricky Solutions
- To: mathgroup at smc.vnet.net
- Subject: [mg94103] RE: [mg94069] Clever Tricky Solutions
- From: "David Park" <djmpark at comcast.net>
- Date: Fri, 5 Dec 2008 05:28:57 -0500 (EST)
- References: <27271771.1228394784179.JavaMail.root@m02>
The following works: px1 = Plot[1/2 Sin[3.14 x], {x, 1, 2}, AxesOrigin -> {0, 0}]; px2 = Plot[Sin[3.14 x], {x, 0, 1}, AxesOrigin -> {0, 0}]; Show[px1, px2, PlotRange -> All] The problems is that the Show statement picks up options from the first plot and uses that, even though the second plot would suggest that something different is needed. This could be done far more intuitively and easily with the Presentations package where options that affect a particular piece of primitive graphics go in the Draw statements and overall plot options go at the end. Needs["Presentations`Master`"] Draw2D[ {Draw[1/2 Sin[3.14 x], {x, 1, 2}], Draw[Sin[3.14 x], {x, 0, 1}]}, Axes -> True] No problem. And in general, with Presentations you just draw objects, and specify graphics directives, one after another - just as you would expect with no surprises or gotchas. David Park djmpark at comcast.net http://home.comcast.net/~djmpark From: Donald DuBois [mailto:donabc at comcast.net] Here is a simple example of why more people don't use Mathematica. px1 = Plot[1/2 Sin[3.14 x ], {x, 1, 2 }, AxesOrigin -> {0, 0}] px2 = Plot[Sin[3.14 x ], {x, 0, 1 }, AxesOrigin -> {0, 0}] Show[px1, px2] does NOT show both graphs. There are multiple steps that the user might go through that may help. A list below in the order that I think most people who are not Mathematica aficionados would use: (1) Go to the Show Help page which is no help at all. (2) Do Options[Show] which produces {}. (3) Digging a little further, you have to realize the px1 and px2 are Graphics objects and that Show inherits these options so do a Options[Graphics]. After playing around with the different options starting with the word "Axes" [since the problem seems to be the axes in the positive half of the graph are missing] you hit upon PlotRange->All does the trick. I'm sure there are reasons why Show does not work in an intuitive, easy to use fashion. But the end result is, since most people don't have the time or patience to go through this mind numbing exercise to get a simple job done, they will use Mathematica only when all other packages fail to deliver what they need. Not a good way of expanding the user base, in my opinion. Clever, tricky solutions are no solutions at all.