[R] Bar Plot with Connected Points on 1 Y-Axis

jimdare jamesdare26 at gmail.com
Wed Jan 7 04:07:02 CET 2009


Hi Everyone,

Have created a bar plot of the data below using the following code: 
barplot(TACC,space=0,names.arg=Year).  I now want to add a series of
connected points to represent the catch. I tried to do this using
line(Catch) or points(Catch), however both of these commands result in each
data point being aligned with the right edge of each bar.  I need them to be
solid points in the centre of each bar, and for each point to be connected
to its neighbour by a line.  Another issue I have is when the points exceed
the values for the bar graph (e.g. in 2004 and 2005 catch>TACC) R seems to
cut them off, I need the axis to be expanded so they can be seen.  I'm sure
these are relatively simple problems but I am really stuck.  Thanks very
much for all your help, it is much appreciated.

James 

DATA:

  Year  Species Stock TACC Catch
1 2001    ORH    OR1   5000  4687
2 2002    ORH    OR1   6000  3215
3 2003    ORH    OR1   7000  6782
4 2004    ORH    OR1   9000 10000
5 2005    ORH    OR1   9000 12000


-- 
View this message in context: http://www.nabble.com/Bar-Plot-with-Connected-Points-on-1-Y-Axis-tp21324029p21324029.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list