Skip to content
Prev 308467 / 398506 Next

how can I make a legend that applies for all the barplots in one same page?

First of all, in the command par(xpd=F), what is the value of F?  If
it is the default value of FALSE then that says to not plot anything
outside of the plot region, so any attempts to put a legend in the
outer margin will not plot anything.  if F is TRUE (which is a recipe
for disaster) then you can put things into the figure region (inner
margins) but it will still not plot in the outer regions.  Only if F
is NA will it allow plotting in the outer margin.  That is why it is
best practice not to use F and T, but to spell out the logical names.
Best for this case is par(xpd=NA).  Now you can plot in the outer
margins.  Use the grconvertX and grconvertY functions to find the
location to put the legend, then use the legend function to plot it.
On Fri, Oct 19, 2012 at 1:22 PM, Yakamu Yakamu <iam_yakamu at yahoo.com> wrote: