Re: Clever Tricky Solutions
- To: mathgroup at smc.vnet.net
- Subject: [mg95800] Re: Clever Tricky Solutions
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Tue, 27 Jan 2009 07:01:46 -0500 (EST)
- References: <27271771.1228394784179.JavaMail.root@m02> <ghavpg$o9j$1@smc.vnet.net> <ghdmvt$frc$1@smc.vnet.net> <ghf70d$pdu$1@smc.vnet.net> <ghj02i$ffs$1@smc.vnet.net> <ghlmd8$jv7$1@smc.vnet.net> <gho38k$6h$1@smc.vnet.net> <ghqjsa$11u$1@smc.vnet.net>
Helen Read wrote: > David Bailey wrote: >> Helen Read wrote: >>>> I agree something like this should be built in to Mathematica, but in >>>> the meantime, how about defining a little function such as: >>>> >>>> showAll[pl_List,opts___Rule]:=Module[{plRanges,x1,x2,y1,y2}, >>>> plRanges=Map[AbsoluteOptions[#,PlotRange]&,pl]; >>>> x1=Min@plRanges[[All,1,2,1,1]]; >>>> x2=Max@plRanges[[All,1,2,1,2]]; >>>> y1=Min@plRanges[[All,1,2,2,1]]; >>>> y2=Max@plRanges[[All,1,2,2,2]]; >>>> Show[pl,PlotRange->{{x1,x2},{y1,y2}},opts] >>>> ]; >>>> >>>> showAll[{px1,px2}] >>> This would so not be worth it for my Calculus students. >>> Show[{plot1,plot2,plot3},PlotRange->Automatic] is a far simpler thing >>> for them to deal with >>> >> Don't you ask your students to load some code (or arrange for it to load >> automatically) before they start work? You could give them all sorts of >> useful tweaks and extra functions by doing that. One way to load code >> automatically is to create a Configuration/Kernel/init.m file with >> definitions in it, or perhaps just a Get command to load stuff from >> elsewhere. > > When I have some code I want the students to run for some specific, > limited situation purpose, of course I provide a file with > initialization cells that I have written. But a built-in function like > Show that the students use every day would not be worth messing with. > The students use Mathematica on University owned computers all over > campus and on their own laptops, and there is no way to get a custom > init.m file everywhere it would need to be. If I put some code altering > the behavior of Show into an init.m file on the machines in our two math > classrooms, it would only serve to confuse the students when they were > working somewhere else. It just wouldn't be worth it. It's far better > for the students to learn to throw in PlotRange->Automatic in Show, and > have a Show function that works consistently wherever they are working. > > -- > Helen Read > University of Vermont > > Helen, I hardly ever suggest modifying built-in functions - it is confusing, and can break between versions, however, I suggested creating a new function - showAll - which would not create such problems! David Bailey http://www.dbaileyconsultancy.co.uk