MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: How to apply one plot range to another plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40041] Re: [mg40025] Re: How to apply one plot range to another plot?
  • From: Dr Bob <drbob at bigfoot.com>
  • Date: Mon, 17 Mar 2003 03:33:21 -0500 (EST)
  • References: <b4s8dt$ici$1@smc.vnet.net> <200303160722.CAA02907@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

Here's the same thing without the extraneous plots:

Block[{$DisplayFunction = Identity, plot1, plot2, plot3},
    plot1 = ListPlot[r = 0; list1 = Table[r += Random[Integer, 20], {60}]];
    plot2 = ListPlot[r = 0; list2 = Table[r += Random[Integer, 25], {80}]];
    plot3 = ListPlot[r = 0; list3 = Table[r += Random[Integer, 15], 
{100}]];
    listPlots = Show[plot1, plot2, plot3];
    pr = PlotRange /. FullOptions[pl1];
    functionPlot = Plot[.1x^2, {x, pr[[1, 1]], pr[[1, 2]]}]
    ];
Show[listPlots, functionPlot, PlotRange -> pr];

Bobby

On Sun, 16 Mar 2003 02:22:46 -0500 (EST), Nigel King <king at dircon.co.uk> 
wrote:

> In <b4s8dt$ici$1 at smc.vnet.net> Beleznay, Akos wrote:
>> Hi,
>> I am merging several listplots (ListPlot[...]) into one graph. In 
>> addition, I am plotting some function (Plot[...]) on the same graph.  
>> How could I keep the automatic axis settings connected only to the
>> listplots? Therefore, the range of the function plot would be determined 
>> by the listplots without always going back and changing the range of the 
>> function plot when I add/change the underlying data of the lisplots.
>
> The following may do what you want
> In[1]:= r = 0; list1 = Table[r += Random[Integer, 20], {60}]; In[2]:= r = 
> 0; list2 = Table[r += Random[Integer, 25], {80}]; In[3]:= r = 0; list3 = 
> Table[r += Random[Integer, 15], {100}]; In[4]:= pl1 = Show[ListPlot[
> list1], ListPlot[list2], ListPlot[list3]]; In[5]:= pr = PlotRange /. 
> FullOptions[pl1] Out[5]=
> {{-2.5, 102.5}, {-25.7, 1053.7}} In[6]:= Show[
> pl1, Plot[.1x^2, {x, pr[[1, 1]], pr[[1, 2]]}], PlotRange -> pr];
>
> Nigel King
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: RE: FindRoot problem
  • Next by Date: Re: Re: Histogram normalization
  • Previous by thread: Re: How to apply one plot range to another plot?
  • Next by thread: Re: How to apply one plot range to another plot?