[R] Scale of axis for two data sets

John Kane jrkrideau at inbox.com
Tue Aug 27 14:58:00 CEST 2013


Way outside my area but I think, well "guess" that  the two panel approach is better since it should give you more discrimination or easily visualized detail for each variable but clearly Jim's suggestion will work too. 

Otherwise, get a sleeping bag and order in some food. It could be a long night/week.

Good luck.

John Kane
Kingston ON Canada

-----Original Message-----
From: mohan.radhakrishnan at polarisft.com
Sent: Tue, 27 Aug 2013 18:21:45 +0530
To: jrkrideau at inbox.com
Subject: RE: [R] Scale of axis for two data sets

Thanks. There is one more idea from Jim Lemon which can also help. 

In my case I am dealing with a sys. admin who thinks the JVM is using all the memory in the linux machine. I think it is http://www.linuxatemyram.com/ [http://www.linuxatemyram.com/]  syndrome. 

So if the junior sys. admin loses perspective I will never be released from this assignment :-) 

So I am gathering 'pmap' output and plotting Total size(Kbytes) and Resident Size(RSS) of the JVM. 

Mohan 

From:        John Kane <jrkrideau at inbox.com> 
To:        mohan.radhakrishnan at polarisft.com 
Cc:        r-help at r-project.org 
Date:        08/27/2013 06:11 PM 
Subject:        RE: [R] Scale of axis for two data sets 

Well I have not spent a lot of time looking  at the data , especially with what appeared to be a constant :)  . It was not clear to me that they were the same units for one thing.

 From my point of view (essentially total ignorance) if you have a situation where you have data plotted with the same set of units it's even dicier to use a two scale plot.  You are just demanding too much of the reader to figure out which line is which and remember that the line attached to the right axis is 10^3 of the values of the left access.

 My solution would probably be to just stack the two graphs one on top of the other , with the top graph having the 'higher' values.  However it is a judgement call and also dependent on the discipline.

 Anyway see the quick and dirty attempt attached to see what I am suggesting.

 John Kane
 Kingston ON Canada

 -----Original Message-----
 From: mohan.radhakrishnan at polarisft.com
 Sent: Tue, 27 Aug 2013 17:31:18 +0530
 To: jrkrideau at inbox.com
 Subject: RE: [R] Scale of axis for two data sets

 Hi, 
               Can't one y-axis be used ? Both 'Kbytes' and 'RSS' use the same unit.  

 Thanks, 
 Mohan 

 From:        John Kane <jrkrideau at inbox.com> 
 To:        mohan.radhakrishnan at polarisft.com 
 Cc:        r-help at r-project.org 
 Date:        08/27/2013 05:13 PM 
 Subject:        RE: [R] Scale of axis for two data sets 

 Still looks like a constant to me :) I think I see what you mean though. It's just that representation of the numbers in the email don't show any difference.  

 Personally I think I'd go with a two panel graph using par() rather than a double-axis graph if you can. Everything I have read about double-axis graphs is  rather negative. However, I know they are standard in some disciplines.

 John Kane
 Kingston ON Canada

 -----Original Message-----
 From: mohan.radhakrishnan at polarisft.com
 Sent: Tue, 27 Aug 2013 17:08:51 +0530
 To: jrkrideau at inbox.com
 Subject: RE: [R] Scale of axis for two data sets

 It is not a constant but changes very slowly. Actually it should be like this. 

 Kbytes                    RSS                   rNo 
 2687188        1287532        1 
 2687188        1287532        2 
 2687188        1287536        3 
 2687188        1287540        4 
 2687188        1287640        5 
 2687188        1287640        6 

 Thanks, 
 Mohan 

 From:        John Kane <jrkrideau at inbox.com> 
 To:        mohan.radhakrishnan at polarisft.com, r-help at r-project.org 
 Date:        08/27/2013 04:57 PM 
 Subject:        RE: [R] Scale of axis for two data sets 

 I am misreading something here I think. Why are you graphing against a constant?

 John Kane
 Kingston ON Canada

 > -----Original Message-----
 > From: mohan.radhakrishnan at polarisft.com
 > Sent: Tue, 27 Aug 2013 13:28:48 +0530
 > To: r-help at r-project.org
 > Subject: [R] Scale of axis for two data sets
 > 
 > Hi,
 > 
 > Kbytes                     RSS                         rNo
 > 
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1450876 1433788
 > 2689632 1460168 1443084
 > 
 > 
 > 
 > plot(data$rNo,data$RSS,pch=0,type="b",col=36,axes=FALSE,  ylab="",
 > xlab="",las=2,lwd=2.5)
 > title(" PID - 23512 / pmap Data Analysis for 1
 > hour",cex.main=3,xlab="Seconds", ylab="Kbytes ", cex.lab=3,1)
 > 
 > axis(side=1, at=seq(0, max(data$rNo), by=5), cex.axis=1.7)
 > axis(side=2, at=seq(0, max(data$Kbytes ), by=1000), cex.axis=1.7)
 > 
 > This code plots Kbytes against rNo.
 > 
 > I tried to combine this with the plot of RSS against rNo. It looks like
 > with the same scale in the y-axis(Kbytes) the second graph(RSS/rNo)
 > doesn't show plots properly. It seems like the second plot draws properly
 > but doesn't match the y-axis scale.
 > 
 > IfI separate the plots into two 'R' files I get it correctly.
 > 
 > How do I used the same y-axis scale(Kbytes) but also plot RSS against
 > rNo.
 > Hope I am not confusing this.
 > 
 > Thanks,
 > Mohan
 > 
 > 
 > 
 > This e-Mail may contain proprietary and confidential information and is
 > sent for the intended recipient(s) only.  If by an addressing or
 > transmission error this mail has been misdirected to you, you are
 > requested to delete this mail immediately. You are also hereby notified
 > that any use, any form of reproduction, dissemination, copying,
 > disclosure, modification, distribution and/or publication of this e-mail
 > message, contents or its attachment other than by its intended
 > recipient/s is strictly prohibited.
 > 
 > Visit us at http://www.polarisFT.com [http://www.polarisft.com/] [http://www.polarisft.com/ [http://www.polarisft.com/]] [http://www.polarisft.com/ [http://www.polarisft.com/] [http://www.polarisft.com/ [http://www.polarisft.com/]]]
 > 
 >                  [[alternative HTML version deleted]]
 > 
 > ______________________________________________
 > R-help at r-project.org mailing list
 > https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help] [https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]] [https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help] [https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]]]
 > PLEASE do read the posting guide
 > http://www.R-project.org/posting-guide.html [http://www.r-project.org/posting-guide.html] [http://www.r-project.org/posting-guide.html [http://www.r-project.org/posting-guide.html]] [http://www.r-project.org/posting-guide.html [http://www.r-project.org/posting-guide.html] [http://www.r-project.org/posting-guide.html [http://www.r-project.org/posting-guide.html]]]
 > and provide commented, minimal, self-contained, reproducible code.

 ____________________________________________________________
 FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
 Check it out at http://www.inbox.com/earth [http://www.inbox.com/earth] [http://www.inbox.com/earth [http://www.inbox.com/earth]] [http://www.inbox.com/earth [http://www.inbox.com/earth] [http://www.inbox.com/earth [http://www.inbox.com/earth]]]

 This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit us at http://www.polarisFT.com [http://www.polarisft.com/] [http://www.polarisft.com/ [http://www.polarisft.com/]]

 ____________________________________________________________
 FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
 Check it out at http://www.inbox.com/marineaquarium [http://www.inbox.com/marineaquarium] [http://www.inbox.com/marineaquarium [http://www.inbox.com/marineaquarium]]

 This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit us at http://www.polarisFT.com [http://www.polarisft.com/]

 ____________________________________________________________
 FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
 Visit http://www.inbox.com/photosharing [http://www.inbox.com/photosharing] to find out more!
 [attachment "mohan.pdf" deleted by Mohan Radhakrishnan/CDOO/polarisFT]  

 This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit us at http://www.polarisFT.com

____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails



More information about the R-help mailing list