Xaxp=c(1,12,11), # x-min tick mark, x-max tick mark, number of intervals between tick marks Sfrac=0.005, # width of error bar as proportion of x plotting region (default 0.01) Gap=0, # distance from symbol to error bar Type="o", # p=points, l=lines, b=both, o=overplotted points/lines, etc. Pch=24, # symbol (plotting character) type: see help(pch) 24 = filled triangle pointing up Uiw=SEM_sham, # error bar length (default is to put this much above and below point) Header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUEĪttach(fig37b) # this is perhaps not the most elegant method: it puts the contents of "fig37b" on the search path "D:/Documents/Techniques/R/PhD_fig37B.csv", The code is commented using # characters for explanation. The code below imports the data, ensures the gplots library is available, and then uses a plotCI call to create the basic graph and the first line with its error bars, another plotCI call to add the second line and error bars, an abline call to add an absolute-referenced line, and a legend. You may also need to edit the code below so that the filename points to wherever you have stored the PhD_fig37B.csv file above.
#Legend sigmaplot 11 install#
You need to install the gplots packages from the R menus if you haven't done so before (Packages > Install Packages > choose a CRAN mirror > select "gplots"). We'll look at one here based on the plotCI function, part of the gplots package. There are a number of ways to achieve this. Note also that the code is longer than it needs to be, because it is spaced and commented for clarity. In all the code that follows, you'll have to change the path names to reflect where you actually put these files.
These files are all comma-separated value (CSV) text files: Two-panel plot with horizontal and vertical error bars.
#Legend sigmaplot 11 update#
Update 2011: these days it looks much easier to work with the ggplot2 library see basic graphs 2. So to begin with, I'll replicate most of the major graph types I created with SigmaPlot for my PhD and MD theses. What we'll be concerned about here is producing publication-quality simple graphs of the types frequently seen in the fields of experimental psychology and behavioural neuroscience, to get you going quickly. R is a very powerful graphing package for examples of what it can do, see the R Graph Gallery.