MathGroup Archive 1996

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

Search the Archive

Re: [Q] HELP! with plot within a BarChart[]

  • Subject: [mg3213] Re: [Q] HELP! with plot within a BarChart[]
  • From: ianc (Ian Collier)
  • Date: 18 Feb 1996 03:20:13 -0600
  • Approved:
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: Wolfram Research, Inc.
  • Sender: daemon at

In article <4frv74$k13 at>,
David.A.Johnson at wrote:

> A while ago I posted a request for help to place a plot within a region
of a plot.
> First I'd like to thank Dave Wagner for his suggestion of
Epilog->Rectangle[{x1,y1}, {x2, y2}, ListPlot[data]]
> However the problem I am now having is that Epilog is not a valid option
of BarChart.
> What I'm trying to accomplish would be something like
> p1 = ListPlot[data1];;
> p2 = ListPlot[data2];;
> BarChart[ data3,    
>                    BarGroupSpacing -> 0,
>                    Epilog->Rectangle[{ x1, y1},{x2,y2},
> if BarChart offered the Epilog functionability.
> I'm running Mma V 2.2 on NeXTStep/FIP if it matters (for version differences).
> Thank's in advance,
> David A. Johnson

You can use the technique for making plots within plots described
in section 2.9.6 of Mathematica A System for Doing Mathematics by

All you do is use separate Rectangle primitives to contain both 
the BarChart and the Graphics Array. Here is an example. You may 
need to tweak the coordiantes of the Rectangles to get your
example to work correctly.

    data1 = Table[ {x, Sin[x]/x}, {x, -10,10, .4}];
    data2 = Table[ {x, Cos[x]}, {x, -10,10, .4}];
    data3 = Table[  x^2/100, {x, -10,10}];
    p1 = ListPlot[data1];

    p2 = ListPlot[data2];

    p3 = BarChart[ data3,    
                   BarGroupSpacing -> 0]

    Show[Graphics[ {Rectangle[{0, 0}, {1, 1}, p3], 
            Rectangle[{0.6, 0.6}, {1.2, 1.4}, 
                GraphicsArray[{{p1,p2}}]]} ]]

I hope this helps.


Ian Collier
Wolfram Research, Inc.
tel:(217) 398-0700   fax:(217) 398-0747    ianc at
Wolfram Research Home Page:

  • Prev by Date: Re: [Q] HELP! with plot within a BarChart[]
  • Next by Date: Re: array ordered
  • Previous by thread: Re: [Q] HELP! with plot within a BarChart[]
  • Next by thread: [Q] HELP! with plot within a BarChart[]