MathGroup Archive 2001

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

Search the Archive

Re: Charting question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29655] Re: [mg29633] Charting question
  • From: BobHanlon at aol.com
  • Date: Mon, 2 Jul 2001 02:20:17 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 2001/6/29 2:09:09 AM, polar at cloud9.net writes:

>I have a couple of questions on setting up multiple charts withinone
>cell.  Basically, I am contructing bar charts for commodities.  I have
>three modules set up ( BarChart, VolumeChart and OpenInterest)  which
>work fine individually.  What I want to do is set these charts with
>price the first chart and volume and open interest charts below the
>price chart.  I can do something similar to what I am looking for with
>Show[GraphicsArray[{{BarChart},{VolumeChart},{OpenInterest}}]] or with
>DisplayTogetherArray[{BarChart},{VolumeChart},{OpenInterest}] .
>However, when I try to use ImageSize to expand the viewing area the
>charts do not expand to take up the entire size used.  For example,
>ImageSize->{600,400} which I thought would make the charts appear like
>a
>landscape view does not work.  The charts are bigger but they do not
>expand lengthwise.
>    Second, is there a way to create two charts within one chart,
>similar to a subwindow?  If possible I would like to call
>BarChart,VolumeChart and OpenInterest and have the Barchart take up 60%
>of the graph are and Volume and OpenInterest each take up 20%.
>    Lastly, is there a way to plot two series in one chart using
>different values on the Y axis.  I have tried MultipleListPlot but it
>doesn't really do what I am looking for.  i want to be able to plot two
>value in one chart where one value may range from 0-100000 and the
>second value may range from 1-100.  I can do this in excel of FAME but
>I
>can't see how to do this in Mathematica.
>

You need to control the AspectRatio of the charts.

Needs["Graphics`Graphics`"]

m = 3; n = 2;

DisplayTogetherArray[
    {Plot[x, {x, 0, 10}, AspectRatio -> (n/m)/3]},
    {Plot[x^2, {x, 0, 10}, AspectRatio -> (n/m)/3]},{Plot[E^x, {x, 0, 10}, 
        AspectRatio -> (n/m)/3]}, 
    ImageSize -> 200*{m, n}];

For different sizes:

Show[Graphics[{
        Rectangle[{0,1},{2,2}, 
          Plot[x, {x, 0, 10}, AspectRatio -> 1/4, 
            DisplayFunction -> Identity]],
        Rectangle[{0,0},{1,1}, 
          Plot[x^2, {x, 0, 10}, DisplayFunction -> Identity]],
        Rectangle[{1,0},{2,1}, 
          Plot[E^x, {x, 0, 10}, DisplayFunction -> Identity]]}], 
    DisplayFunction -> $DisplayFunction, ImageSize -> {600, 400}];

For inlays:

Show[Graphics[{
        Rectangle[{0,0},{2,2}, 
          Plot[x, {x, 0, 10}, DisplayFunction -> Identity]],
        Rectangle[{0.1,1.1},{1,2}, 
          Plot[x^2, {x, 0, 10}, DisplayFunction -> Identity]],
        Rectangle[{1.1,0.1},{2,1}, 
          Plot[E^x, {x, 0, 10}, DisplayFunction -> Identity]]}], 
    DisplayFunction -> $DisplayFunction, ImageSize \[Rule] {600, 400}];

Using two y-axes is an FAQ and someone will provide the URL for the answer at 
the Mathematica site.


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: RE: Charting question
  • Next by Date: a problem with differentiation
  • Previous by thread: RE: Charting question
  • Next by thread: a problem with differentiation