Re: [R] Barplot Labels Problem

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Wed, 05 Nov 2008 07:51:37 -0500

On 05/11/2008 7:16 AM, Rodrigo Aluizio wrote:
> Hi List, well Iíve already asked this before, but I canít figure out a
> solution for the problem after trying many different ways.
>
> So I writing againÖ
>
> Iím using barplot function. I pretend to create a horizontal barplot with
> two different information (side by side) for a species list. Well I can
> generate the graph easily, but the problem is that the labels with the
> species names are cut by device window!! Iíve tried lots of par functions
> none seems to work properly.
>
> Below are the script.
>
>
>
> Height is a matrix of species and two column of numerical data. I used
> par(las=) function to make the labels horizontal. When I do this they are
> cut by the device window. If I donít do that the label stay vertical and
> make nonsense with the graph.

You probably want a larger left margin. That means increasing the second component of par("mar").

I'd demonstrate, but your example code isn't reproducible.

People: you get much better answers if you post code that is easy for others to run. Then they can modify it and you'll get an example that works, rather than speculation about what might work. Don't rely on non-base packages (unless you are asking about one of them); don't post huge datasets or huge R scripts. Work out what is the essence of your question, and extract the code to show just that.

Duncan Murdoch

>
>
>
> library(xlsReadWrite)
>
> Spp<-read.xls('SppPrincipaisFVeFT.xls',sheet=1,rowNames=T)
>
> Spp<-as.matrix(Spp)
>
> barplot(t(Spp),axis.lty='solid',horiz=T,beside=T,las=1,col=c('lightgray','bl
> ack'),main='Main Speceis')
>
> legend('topright',c('Living Fauna','Dead
> Fauna'),fill=c('lightgray','black'),bty='n')
>
>
>
> Thanks for your attention
>
>
>
> ___________________________________
> MSc. <mailto:r.aluizio_at_gmail.com> Rodrigo Aluizio
> Centro de Estudos do Mar/UFPR
> Laboratůrio de Micropaleontologia
> Avenida Beira Mar s/n - CEP 83255-000
> Pontal do ParanŠ - PR - BRASIL
>
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help_at_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.



R-help_at_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. Received on Wed 05 Nov 2008 - 12:54:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Nov 2008 - 13:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive