tag:blogger.com,1999:blog-1729473899912561945.post5807210863465191700..comments2022-04-03T17:26:21.164-07:00Comments on EvolvingSpaces: Multiple Y-axis in a R plotUnknownnoreply@blogger.comBlogger14125tag:blogger.com,1999:blog-1729473899912561945.post-58301209019313959302019-12-27T08:04:35.768-08:002019-12-27T08:04:35.768-08:00thanksthanksAnonymoushttps://www.blogger.com/profile/02249881028176915926noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-32810083305785712812016-10-05T03:01:13.248-07:002016-10-05T03:01:13.248-07:00Many Thanks for your wonderful post. I can plot 3 ...Many Thanks for your wonderful post. I can plot 3 Y axis like you. When I plot 4th, it is redrawn on same 3rd Y axis. I had modified par giving more space for left margin. However still 4th Y axis redraws on 3rd. Would like to know the solution.Anonymoushttps://www.blogger.com/profile/04391440024513250639noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-22490567022880389492015-08-11T03:58:41.077-07:002015-08-11T03:58:41.077-07:00i am unable to run the script on my data.. anyone ...i am unable to run the script on my data.. anyone please help.<br /><br />DO (mg/l) EC (mmho/cm) TC (MPN/100 ml)<br />7.7 312.0 8740<br />6.9 324.5 12700<br />7.1 282.5 16200<br />7.7 271.5 14700<br />7.3 268.5 29700<br />7.2 311.5 37500<br />9.3 397.5 17500<br />8.8 348.6 11700<br />6.4 311.1 12700<br />6.8 349.1 13500<br />6.6 171.0 5500<br />6.7 260.0 9500<br />7.7 275.0 1480<br />7.6 349.0 17000<br />6.2 300.0 8400<br />8.0 265.0 24000<br />7.3 278.0 5400<br />7.3 259.0 54000<br />7.1 364.0 21000<br />11.5 431.0 14000<br />6.1 266.1 9400<br />6.7 356.1 16000<br />6.8 342.0 11000<br />6.2 325.3 8477<br />6.2 321.2 8372<br />6.4 333.9 8702<br />6.5 337.5 8795<br />6.4 336.0 8756<br />6.6 342.0 8912<br />6.6 343.3 8947<br />6.6 344.2 8970<br />6.6 346.1 9021<br />6.2 323.5 8430<br />6.5 338.8 8830<br />6.3 326.5 8508<br />6.3 327.1 8523<br />6.2 323.5 8430<br />6.1 319.0 8313<br />6.7 348.8 9090<br />9.5 182.0 2100Mrunmayeehttps://www.blogger.com/profile/15425241215996026372noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-88388293133557851702013-08-07T22:09:03.143-07:002013-08-07T22:09:03.143-07:00Hi thanks for this little manual, one problem I´m ...Hi thanks for this little manual, one problem I´m facing right now is that the second y-axis is paionted outside of the plotting area..is there a way to automatically adjust the scale?cretapehttps://www.blogger.com/profile/12108844983762604745noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-68929623685244906872013-07-11T03:14:11.596-07:002013-07-11T03:14:11.596-07:00Thanks very much for the useful post. I am trying ...Thanks very much for the useful post. I am trying to achieve exactly the same result, only this time with "population" mapped to a bar chart with bar plot(), seems impossible to align the points along the line plots (e.g. from Number of groups in this example) to the midpoints of the bars from the population bar plot. How can I do this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-35527452048242353722012-11-07T03:46:39.567-08:002012-11-07T03:46:39.567-08:00Thanks for this post, it is very helpful. Is it po...Thanks for this post, it is very helpful. Is it possible to do this but with different x values as well? I have two sets of timeseries data, so I still only want one x-axis (time), but the 2 datasets are different lengths. Is there a modification of your method that would allow this? Many thanks.Z.Thomashttps://www.blogger.com/profile/07212655076411842689noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-35125194323462733652012-10-25T11:45:04.583-07:002012-10-25T11:45:04.583-07:00Hey, Thank you so much! Your example has been the...Hey, Thank you so much! Your example has been the most helpful for me trying to figure out how to put multiple Y axes over the same X axis. Much appreciated.johnyboyhttps://www.blogger.com/profile/18151857780583206865noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-12805484404639089162012-10-19T08:45:30.229-07:002012-10-19T08:45:30.229-07:00It works!
Thanks again!It works!<br /><br />Thanks again!Nereahttps://www.blogger.com/profile/10149814629025206354noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-54087869365897400992012-10-19T07:24:30.153-07:002012-10-19T07:24:30.153-07:00@Nerea, I think you could use the parameter "...@Nerea, I think you could use the parameter "yaxp" inside the function axis(). For example if you type:<br /><br />plot(time, med, axes=F, ylim=c(0,3.5), xlab="", ylab="", <br />type="l",lty=2, main="",xlim=c(7000,3400),lwd=2)<br />axis(2, yaxp=c(0,3.5,7),lwd=2,line=3.5)<br /><br />it should work...E.Cremahttps://www.blogger.com/profile/17036230861420924423noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-20422799270051354982012-10-19T07:14:19.015-07:002012-10-19T07:14:19.015-07:00@ Aparna, that's odd....does it give you an er...@ Aparna, that's odd....does it give you an error message?E.Cremahttps://www.blogger.com/profile/17036230861420924423noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-56106333994611433322012-10-19T06:36:52.681-07:002012-10-19T06:36:52.681-07:00Hi! thanks for the post, it has been very usefull....Hi! thanks for the post, it has been very usefull. I only have one more question. As you can see your 2nd Y-axis (Median Groupe Size) is a little longer than the other two. How coul I fix it? I've tried it modifying ylim but I'm not able to get the result that I'm looking for.<br /><br />Thanks in advance,<br /><br />NereaNereahttps://www.blogger.com/profile/10149814629025206354noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-5569390424662537062012-09-09T20:21:47.028-07:002012-09-09T20:21:47.028-07:00Hi! Thanks for writing this post. But when I try t...Hi! Thanks for writing this post. But when I try the commands, I am getting the different axes but the graph is not plotted. Can you tell me what I am missing?Aparna Sampathhttps://www.blogger.com/profile/07382325489911345483noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-83296504531765104202011-05-10T04:28:03.904-07:002011-05-10T04:28:03.904-07:00Thanks! You can change the background color using ...Thanks! You can change the background color using par(bg="lightgrey"), and possible add a grid using the function...well..grid(), which allows you to define the number of rows and columns. A longer but perhaps more elegant option is to use abline().<br />E.E.Cremahttps://www.blogger.com/profile/17036230861420924423noreply@blogger.comtag:blogger.com,1999:blog-1729473899912561945.post-35913597947604063332011-05-10T03:09:35.824-07:002011-05-10T03:09:35.824-07:00Great post, I liked the creative use of Par(New=T)...Great post, I liked the creative use of Par(New=T) combined with left margin space to depict scales of different series. <br />Is it possible to add a background grey grid to this plot, as I would like to use this framework for some of my plots. thnks and rgds, snvkAnalysthttps://www.blogger.com/profile/08676345908889574216noreply@blogger.com