Re: [R] barcharts with 2 different axes

From: Geoff Russell <geoffrey.russell_at_gmail.com>
Date: Fri 27 Oct 2006 - 06:54:26 GMT

 Hi Deepayan,

On 10/27/06, Deepayan Sarkar <deepayan.sarkar@gmail.com> wrote:
>
> On 10/26/06, Geoff Russell <geoffrey.russell@gmail.com> wrote:
> > Dear UseRs,
> >
> > I'm having trouble drawing a barchart with 2 quantities in different
> units
> > as follows with
> > one unit on the top axis and the other unit on the bottom. E.g.,
> >
> > x Tonnes | .
> > . .
> >
> > Row 1 Tonnes1 | xxxxxxxxxx
> > Row 1 Litres1 | yyyyyyy
> >
> > Row 2 Tonnes1 | xxxxxxxxxxxxxxxxxxxxx
> > Row 2 Litres1 | yyyyyyyyyyyyyyyy
> >
> > y Litres | .
>
> So if I read this right, the relative heights of the xxx bars and the
> yyy bars, which you have placed side by side, are in different units
> and thus their comparison is meaningless. It's doable, but do you
> really want this sort of graph? A better and much easier to implement
> design seems to be something like

Yes, that is better than what I had in mind, and it will scale when I get the data for the other columns I have in mind. Sample data is below.

      +-------------------------+---------------------+

> Row 1 | xxxxxxxxxx | yyyyyyy |
> Row 2 | xxxxxxxxxxxxxxxxxxxxx | yyyyyyyyyyyyyyyy |
> +-------------------------+---------------------+
> Tonnes1 Litres1
>
> > Can anybody provide an example please?
>
> Please provide some example data (the form of which will matter).
>
> -Deepayan

Many thanks.

Geoff.

csv data,

                                      "Area '000 ha", "Volume '000 ML"
"Pastures for Grazing"                 , 710       ,    2826.9

"Pastures for Seed"                    ,  32       ,    139
"Pastures for hay/silage"              , 162       ,    683
"Cereal crops for hay"                 ,  66       ,    246
"Cereal crops for grain/seed"          , 365       ,    1002

"Cereal crops not for grain/seed"      ,  42       ,    127
"Rice"                                 ,  44       ,    615
"Sugar Cane"                           , 238       ,    1293

"Cotton"                               , 234       ,    1525
"Other broadacre crops"                ,  68       ,    172
"Fruit Trees, nuts, plantations/fruits", 138       ,    660
"Vegetables for human use"             , 112       ,    439
"Vegetables for seed"                  ,   4       ,    8.4
"Nurseries/flowers/turf"               ,  13       ,    77.9
"Grapevines"                           , 150       ,    588

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Oct 27 17:00:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 28 Oct 2006 - 01:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.