Your example works because you have only 5 really long labels. I tried
changing 5 to 474 because that is how many I have and the plot looks
illegible. Should I increase the margin or the height of the plotting
window? Thanks for your help again.

## dummy data
set.seed(123)
dummy <- data.frame(A = sample(paste("really long labels", 1:474), 100,
                              replace = TRUE),
                   B = rnorm(100))
str(dummy)
head(dummy)
## plot it
boxplot(B ~ A, data = dummy, horizontal = TRUE, las = 1)
## Hmm labels are truncated on left margin. How do I stop that?


On Mon, Aug 10, 2009 at 1:57 PM, Gavin Simpson <gavin.simp...@ucl.ac.uk>wrote:

> On Mon, 2009-08-10 at 13:41 -0400, mmv.listservs wrote:
> > I should give an example
>
> Thanks for that - I just two seconds ago sent a reply to the list
> complaining because you didn't provide one. However, the code below
> doesn't work.
>
> >
> > for(p in 1:100)
> > {
> >     str <- paste("Task", p, sep=" ")
> >     task_name[p] <- str
> > }
>
> We don't have task_name so this bit fails
>
> >
> > ## first set the random seed so we get the same results
> > set.seed(123)
> > ## now produce some dummy data
> > dummy <- data.frame(A = sample(LETTERS[1:4], 100, replace = TRUE),
> >                    B = sample(c("T","F"), 100, replace = TRUE),
> >                    C = rnorm(100))
> >
> > dummy <- cbind(dummy, task_name)
>
> As does this bit
>
> >
> > names(dummy)
> >
> > plot(dummy$A, dummy$task_name)
>
> So we don't get the plot I think you wanted us to get here.
>
> If my reply (winging its way to you as we speak) doesn't solve the
> problem, then work on your example so that it works in a clean R
> session. If you start a new R session and paste in your code/example,
> you'll see if it runs OK or not.
>
> HTH
>
> G
>
> >
> > if you look at the plot you see the task names are printed but cut off.
> >
> > if I change the plot command using as.numeric I get task names with
> numbers.
> > It is still hard to interpret which number the task is referring too?
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> --
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>  Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
>  ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
>  Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
>  Gower Street, London          [w] 
> http://www.ucl.ac.uk/~ucfagls/<http://www.ucl.ac.uk/%7Eucfagls/>
>  UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to