Re: Show graphics command
- To: mathgroup at smc.vnet.net
- Subject: [mg40366] Re: [mg40347] Show graphics command
- From: Helge Andersson <helge at envic.chalmers.se>
- Date: Thu, 3 Apr 2003 01:41:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Nathan, You can surpress the printout of plots by setting the DisplayFunction option to Identity. Recall the default setting in the Show-command with $Displayfunction as in below. data =Table[{x,x^2 + Random[Real, {- .4, .4}]}, {x, -2, 2, .2}]; fitfun = Fit[data, {1, x, x^2}, x]; plota = ListPlot[data, PlotStyle -> PointSize[ .02], DisplayFunction -> Identity]; plotb = Plot[fitfun, {x, -2, 2}, DisplayFunction -> Identity]; Show[{plota, plotb}, DisplayFunction -> $DisplayFunction]; Or just use DisplayTogether DisplayTogether[{ListPlot[data, PlotStyle -> PointSize[.02]], Plot[fitfun, {x, -2, 2}]}]; /Helge Chalmers University of Technology Sweden At 04:36 2003-04-02 -0500, you wrote: >The list operations have been very useful. > >Here's a pet peeve. Often when I combine several graphics objects with >the show command I get a bunch of extraneous plots. Suppose I have a list >of {x,y} pairs (named "data") and a fit function f[x] and I want to show >them together. The easiest way to do this is with the command, > >Show[ListPlot[data],Plot[f[x],{x,0,Xo}] > >When I execute this I get 3 plots, ListPlot[data], the Plot[f[x]], and >then the tro combined. How can I have the front end suppress the first >two plots? (this "error" is especially annoying when I'm plotting 7 or 8 >lists together) > >Nathan Moore