Re: Show graphics command
- To: mathgroup at smc.vnet.net
- Subject: [mg40387] Re: Show graphics command
- From: Bill Rowe <listuser at earthlink.net>
- Date: Thu, 3 Apr 2003 01:44:59 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 4/2/03 at 4:36 AM, nmoore at physics.umn.edu (Nathan Moore) 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?
Use the DisplayFunction option. Setting DisplayFunction->Identity suppresses display of the plots. For your specific example
Show[
ListPlot[data,DisplayFunction->Identity],
Plot[f[x],{x,0,X0},DisplayFunction->Identity],
DisplayFunction->$DisplayFunction]
will display the one combined plot you are interested in