I can't figure out how to get the x-axis to contain the category lables for my frequency polygon. I'm also not sure if there is a more elegant approach. Any insights on the labels? I tried this: #generate some pseudo data x=c(sort(sample(1:1500,5)),sort(sample(1:1500,3),dec=T)) # assign names to the vector names(x)=c("0-13","14-19","50-99","100-149","150-199","200-249","250-299","3 00+") #Plot a frequency polygon # This displays as inicies, not labels: plot(x,type="b",col="red") #This almost works (adds labels) but produces errors and scrambles y-axis plot(x,type="b",col="red",labels=labels(x)) I looked at ?axis but could not see a solution there. Thanks in advance. Rob
In a (off-list) response to a question of frequency polygons, Dr Paul Murrell writes:> There's an "ann" arg which you can use to turn off the default labels > (ann=FALSE). Have you seen help(plot.default) as well as help(plot)?Thank you again, Paul. Interestingly, the ?plot help contains no mention of the 'ann' parameter. In fact, I have been guessing about what parameters are legal in plot() or using examples from various R tutorials because ?plot help just enumerates them with as ... after x and y. I did not know that plot.default existed although I now find it in response to a help.search("plot"). This search produces many plot.something() functions. I knew nothing about any of these "other" plot functions. There has been mention of S3 objects on the list. Is this relevant here? Is 'plot.default' a method (or perhaps a type-dependent object instantiation?) of the "plot function" object, or is 'plot.default' just a second function object that shares a part of a name and uses a "convenience" dot for readability? Does R have standard naming conventions in this regard? I'm guessing that 'plot.default' is a method? of 'plot'. Assuming that other 'plot.something' functions are methods or instantiations of a main 'plot' function object, how do I learn more about such a "main" object's subparts short of studying code? The ?plot help document does not have a "see also" for plot.default or (many) other 'plot.something' functions. Is there a simple way to troll for such things when trying to expand your horizons? Any general hints on how one should approach the self-education process in this type of situation? Thanks, Rob Baer