MathGroup Archive 2003

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40025] Re: How to apply one plot range to another plot?
  • From: Nigel King <king at dircon.co.uk>
  • Date: Sun, 16 Mar 2003 02:22:46 -0500 (EST)
  • References: <b4s8dt$ici$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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


  • Prev by Date: FindRoot problem
  • Next by Date: Odd memory behavior, and uncontrollable memory growth
  • Previous by thread: How to apply one plot range to another plot?
  • Next by thread: Re: Re: How to apply one plot range to another plot?