Skip to main content
7 events
when toggle format what by license comment
Apr 21, 2017 at 18:59 comment added Jess Riedel I am switching this to the accepted answer almost 5 years after asking it because Simon's answer no longer works in Mathematica 11.
Apr 21, 2017 at 18:58 vote accept Jess Riedel
Jul 24, 2012 at 18:28 comment added DGrady @Mr.Wizard You know, that's a really good point - I found this through experimentation and didn't think about it too much, but it does mean that Plot must be using ReleaseHold at some point in the evaluation. And not all the plotting functions behave the same way: DiscretePlot[Evaluate@Table[g[n*x], {n, 1, 3}], {x, 0, 1, 0.1}] produces empty axes, for example. Just when you think you understand something...
Jul 24, 2012 at 10:06 comment added Mr.Wizard I didn't know that Plot would work with expressions inside Hold! Where is this documented?
Jul 23, 2012 at 22:10 comment added DGrady @Jess It's a good point, and I don't think there's a way around it with this approach. I'm glad you found the explanation clear, though!
Jul 23, 2012 at 20:47 comment added Jess Riedel Thanks very much! This is very close to a perfect answer, except that it requires me to redefine g[y]. Ideally we wouldn't need to do this because g might be a black box. We could just define h[y_]:=Hold[g[y]] and use that, although this is still slightly awkward.
Jul 23, 2012 at 20:11 history answered DGrady CC BY-SA 3.0